From: <an...@us...> - 2008-02-17 01:37:16
|
Revision: 1382 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1382&view=rev Author: and-81 Date: 2008-02-16 17:37:14 -0800 (Sat, 16 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Documentation/new.html 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/RawInput.cs trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Property Changed: ---------------- trunk/plugins/RC102 Plugin/ Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -98,7 +98,6 @@ else { IPAddress serverIP = Client.GetIPFromName(_serverHost); - IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); if (StartClient(endPoint)) Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -97,7 +97,6 @@ else { IPAddress serverIP = Client.GetIPFromName(_serverHost); - IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); if (StartClient(endPoint)) Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -357,14 +357,17 @@ /// <summary> - /// Translates a host name or address into an IPAddress object. + /// Translates a host name or address into an IPAddress object (IPv4). /// </summary> /// <param name="name">Host name or IP address.</param> /// <returns>IPAddress object.</returns> public static IPAddress GetIPFromName(string name) { + // Automatically convert localhost to loopback address, avoiding lookup calls for systems that aren't on a network. + if (name.Equals("localhost", StringComparison.OrdinalIgnoreCase)) + return IPAddress.Loopback; + IPAddress[] addresses = Dns.GetHostAddresses(name); - foreach (IPAddress address in addresses) if (address.AddressFamily == AddressFamily.InterNetwork) return address; Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-17 01:37:14 UTC (rev 1382) @@ -35,6 +35,7 @@ <LI>MCE Remote Receiver: Can now set remote and keyboard repeat rates to mimic system keyboard repeat rate settings.</LI> <LI>IR Server Plugin: Added support for HCW (Hauppauge) Receiver - Experimental.</LI> <LI>Translator: Added a "remap" button for changing the button associated with a command.</LI> +<LI>TCP Comms: Automatically map "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a problem for some users.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -22,9 +22,19 @@ static void Remote(string code) { - Console.WriteLine(code); + Console.WriteLine("Remote: {0}", code); } + static void Keyboard(int button, bool up) + { + Console.WriteLine("Keyboard: {0}, {1}", button, up); + } + + static void Mouse(int x, int y, int buttons) + { + Console.WriteLine("Mouse: ({0}, {1}) - {2}", x, y, buttons); + } + [STAThread] static void Main() { @@ -33,16 +43,15 @@ c.Configure(null); c.RemoteCallback += new RemoteHandler(Remote); + c.KeyboardCallback += new KeyboardHandler(Keyboard); + c.MouseCallback += new MouseHandler(Mouse); - c.Start(); Application.Run(); c.Stop(); c = null; - - } #region Constants @@ -376,9 +385,11 @@ Trace.WriteLine(String.Format("Extra: {0}", raw.mouse.ulExtraInformation)); Trace.WriteLine(String.Format("Button Data: {0}", raw.mouse.buttonsStr.usButtonData)); Trace.WriteLine(String.Format("Button Flags: {0}", raw.mouse.buttonsStr.usButtonFlags)); + Trace.WriteLine(String.Format("Last X: {0}", raw.mouse.lLastX)); + Trace.WriteLine(String.Format("Last Y: {0}", raw.mouse.lLastY)); #endif - //if (_mouseHandler != null) - //_mouseHandler(0, 0, (int)raw.mouse.ulButtons); + if (_mouseHandler != null) + _mouseHandler(raw.mouse.lLastX, raw.mouse.lLastY, (int)raw.mouse.ulButtons); break; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -11,6 +11,9 @@ namespace InputService.Plugin { + /// <summary> + /// Device Details used to register for raw input. + /// </summary> internal class DeviceDetails { string _name; @@ -18,21 +21,37 @@ ushort _usagePage; ushort _usage; + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> public string Name { get { return _name; } set { _name = value; } } + /// <summary> + /// Gets or sets the ID. + /// </summary> + /// <value>The ID.</value> public string ID { get { return _id; } set { _id = value; } } + /// <summary> + /// Gets or sets the usage page. + /// </summary> + /// <value>The usage page.</value> public ushort UsagePage { get { return _usagePage; } set { _usagePage = value; } } + /// <summary> + /// Gets or sets the usage. + /// </summary> + /// <value>The usage.</value> public ushort Usage { get { return _usage; } Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -30,7 +30,7 @@ InitializeComponent(); comboBoxPort.Items.Clear(); - comboBoxPort.Items.AddRange(Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort))); + comboBoxPort.Items.AddRange(Enum.GetNames(typeof(InputService.Plugin.BlasterPort))); comboBoxPort.SelectedIndex = 0; labelLearned.Text = "Not yet learned"; @@ -90,21 +90,21 @@ string fileName = MCEReplacement.IRFolder + name + Common.FileExtensionIR; - IRServerPluginInterface.LearnStatus status = MCEReplacement.LearnIR(fileName); + InputService.Plugin.LearnStatus status = MCEReplacement.LearnIR(fileName); switch (status) { - case IRServerPluginInterface.LearnStatus.Failure: + case InputService.Plugin.LearnStatus.Failure: labelLearned.Text = "Failed to learn IR command"; labelLearned.ForeColor = Color.Red; break; - case IRServerPluginInterface.LearnStatus.Timeout: + case InputService.Plugin.LearnStatus.Timeout: labelLearned.Text = "IR learning timed-out"; labelLearned.ForeColor = Color.Blue; break; - case IRServerPluginInterface.LearnStatus.Success: + case InputService.Plugin.LearnStatus.Success: labelLearned.Text = "Successfully learned IR command"; labelLearned.ForeColor = Color.Green; buttonTest.Enabled = true; Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -307,7 +307,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), selected.Substring(Common.CmdPrefixBlast.Length)); if (blastCommand.ShowDialog(this) == DialogResult.OK) @@ -551,7 +551,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), commands); if (blastCommand.ShowDialog(this) == DialogResult.OK) Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -16,7 +16,6 @@ using MediaPortal.Hardware; using MediaPortal.Util; -using MicrosoftMceTransceiver; using IrssUtils; using IrssUtils.Forms; using MPUtils.Forms; @@ -531,7 +530,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), selected.Substring(Common.CmdPrefixBlast.Length)); if (blastCommand.ShowDialog(this) == DialogResult.OK) @@ -830,7 +829,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), commands); if (blastCommand.ShowDialog(this) == DialogResult.OK) Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -256,7 +256,7 @@ blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.STBFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), command.Substring(Common.CmdPrefixSTB.Length), blastCommandCount--); @@ -281,7 +281,7 @@ blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.STBFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), command.Substring(Common.CmdPrefixSTB.Length)); listViewExternalCommands.Items[i].SubItems[1].Text = Common.CmdPrefixSTB + blastCommand.CommandString; @@ -348,7 +348,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), commands); if (blastCommand.ShowDialog(this) == DialogResult.OK) @@ -361,7 +361,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.STBFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), commands); if (blastCommand.ShowDialog(this) == DialogResult.OK) @@ -490,7 +490,7 @@ BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), selected.Substring(Common.CmdPrefixBlast.Length)); if (blastCommand.ShowDialog(this) == DialogResult.OK) Modified: trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -1906,7 +1906,7 @@ BlastCommand blastCommand = new BlastCommand( new IrssUtils.BlastIrDelegate(MCEReplacement.BlastIR), MCEReplacement.IRFolder, - Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + Enum.GetNames(typeof(InputService.Plugin.BlasterPort)), text.Substring(IrssUtils.Common.CmdPrefixBlast.Length)); if (blastCommand.ShowDialog(this) == DialogResult.OK) Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-16 22:49:32 UTC (rev 1381) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-17 01:37:14 UTC (rev 1382) @@ -23,7 +23,8 @@ using MediaPortal.Player; using MediaPortal.Util; -using MicrosoftMceTransceiver; +using InputService.Plugin; + using IrssUtils; using IrssUtils.Forms; using MPUtils; @@ -71,7 +72,7 @@ #region Variables - static MicrosoftMceTransceiver.MicrosoftMceTransceiver _mceTransceiver; + static InputService.Plugin.MicrosoftMceTransceiver _mceTransceiver; static bool _logVerbose; static bool _requireFocus; @@ -122,7 +123,7 @@ /// Gets or sets the mce transceiver. /// </summary> /// <value>The mce transceiver.</value> - internal static MicrosoftMceTransceiver.MicrosoftMceTransceiver MceTransceiver + internal static InputService.Plugin.MicrosoftMceTransceiver MceTransceiver { get { return _mceTransceiver; } set { _mceTransceiver = value; } @@ -359,8 +360,8 @@ { try { - _mceTransceiver = new MicrosoftMceTransceiver.MicrosoftMceTransceiver(); - _mceTransceiver.RemoteCallback = new IRServerPluginInterface.RemoteHandler(RemoteButtonReceived); + _mceTransceiver = new MicrosoftMceTransceiver(); + _mceTransceiver.RemoteCallback = new RemoteHandler(RemoteButtonReceived); _mceTransceiver.Start(); } catch (Exception ex) @@ -487,8 +488,8 @@ try { - _mceTransceiver = new MicrosoftMceTransceiver.MicrosoftMceTransceiver(); - _mceTransceiver.RemoteCallback = new IRServerPluginInterface.RemoteHandler(setupForm.ReceivedRemoteButton); + _mceTransceiver = new MicrosoftMceTransceiver(); + _mceTransceiver.RemoteCallback = new RemoteHandler(setupForm.ReceivedRemoteButton); while (true) { @@ -925,6 +926,9 @@ Log.Info("MCEReplacement: Tune request - Card: {0}, Channel: {1}", msg.Label2, msg.Label); + if (_externalChannelConfigs == null) + throw new ApplicationException("Cannot process tune request, no STB settings are loaded"); + try { Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); @@ -1475,16 +1479,22 @@ /// </summary> /// <param name="fileName">File to place learned IR command in (absolute path).</param> /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> - internal static IRServerPluginInterface.LearnStatus LearnIR(string fileName) + internal static LearnStatus LearnIR(string fileName) { - IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; + LearnStatus status = LearnStatus.Failure; + if (_mceTransceiver == null) + { + Log.Warn("MCEReplacement: Cannot learn IR, device interface not started"); + return status; + } + try { byte[] data; status = _mceTransceiver.Learn(out data); - if (status == IRServerPluginInterface.LearnStatus.Success) + if (status == LearnStatus.Success) { if (data == null || data.Length == 0) throw new ApplicationException("No data learned"); @@ -1511,6 +1521,12 @@ if (LogVerbose) Log.Debug("MCEReplacement - BlastIR(): {0}, {1}", fileName, port); + if (_mceTransceiver == null) + { + Log.Warn("MCEReplacement: Cannot blast IR, device interface not started"); + return; + } + using (FileStream file = File.OpenRead(fileName)) { if (file.Length == 0) Property changes on: trunk/plugins/RC102 Plugin ___________________________________________________________________ Name: svn:ignore + obj bin *.suo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-19 05:29:07
|
Revision: 1385 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1385&view=rev Author: and-81 Date: 2008-02-18 21:29:01 -0800 (Mon, 18 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.png trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.xml Added: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/RC102.xml 2008-02-19 05:29:01 UTC (rev 1385) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<skin> + <button name="Power" code="0" shortcut="None" top="54" left="49" height="37" width="37" /> + <button name="Up" code="1" shortcut="Up" top="54" left="102" height="37" width="37" /> + <button name="Back" code="2" shortcut="Back" top="54" left="155" height="37" width="37" /> +</skin> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-19 05:29:01 UTC (rev 1385) @@ -35,7 +35,9 @@ <LI>MCE Remote Receiver: Can now set remote and keyboard repeat rates to mimic system keyboard repeat rate settings.</LI> <LI>IR Server Plugin: Added support for HCW (Hauppauge) Receiver - Experimental.</LI> <LI>Translator: Added a "remap" button for changing the button associated with a command.</LI> -<LI>TCP Comms: Automatically map "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a problem for some users.</LI> +<LI>IR Server Plugin: Added support for RC102 and compatible receivers - Experimental.</LI> +<LI>TCP Comms: Automatically maps "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a host name lookup problem for some users.</LI> +<LI>IR Server Plugin: Added General HID plugin, should enable mapping special keyboard buttons (like Forward, Back, Play, Stop, Volume, etc...).</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -63,7 +63,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "Support the Ads Tech PTV-335 Receiver."; } } + public override string Description { get { return "Supports the Ads Tech PTV-335 Receiver"; } } /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -20,16 +20,16 @@ public class CustomHIDReceiver : PluginBase, IConfigure, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver { + #region Debug + static void Remote(string code) { Console.WriteLine("Remote: {0}", code); } - static void Keyboard(int button, bool up) { Console.WriteLine("Keyboard: {0}, {1}", button, up); } - static void Mouse(int x, int y, int buttons) { Console.WriteLine("Mouse: ({0}, {1}) - {2}", x, y, buttons); @@ -45,7 +45,7 @@ c.RemoteCallback += new RemoteHandler(Remote); c.KeyboardCallback += new KeyboardHandler(Keyboard); c.MouseCallback += new MouseHandler(Mouse); - + c.Start(); Application.Run(); @@ -54,6 +54,8 @@ c = null; } + #endregion Debug + #region Constants static readonly string ConfigurationFile = @@ -108,7 +110,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "Supports HID USB devices."; } } + public override string Description { get { return "Supports HID USB devices"; } } /// <summary> /// Start the IR Server plugin. @@ -359,18 +361,14 @@ byte[] newArray = new byte[raw.hid.dwSizeHid]; Array.Copy(bRawData, offset, newArray, 0, newArray.Length); - StringBuilder str = new StringBuilder(); - str.Append("HID: "); + string code = BitConverter.ToString(newArray); - foreach (byte b in newArray) - str.Append(String.Format("{0:X2} ", b)); - #if TRACE - Trace.WriteLine(str.ToString()); + Trace.WriteLine(code); #endif if (_remoteHandler != null) - _remoteHandler(str.ToString()); + _remoteHandler(code); break; } @@ -397,14 +395,14 @@ case RawInput.RawInputType.Keyboard: { #if TRACE - Trace.WriteLine(String.Format("Keyboard Event")); + Trace.WriteLine("Keyboard Event"); #endif switch (raw.keyboard.Flags) { case RawInput.RawKeyboardFlags.KeyBreak: #if TRACE - Trace.WriteLine( String.Format("Break: {0}", raw.keyboard.VKey)); + Trace.WriteLine(String.Format("Break: {0}", raw.keyboard.VKey)); #endif if (_keyboardHandler != null) @@ -414,7 +412,7 @@ case RawInput.RawKeyboardFlags.KeyE0: #if TRACE - Trace.WriteLine( String.Format("E0: {0}", raw.keyboard.MakeCode)); + Trace.WriteLine(String.Format("E0: {0}", raw.keyboard.MakeCode)); #endif if (_keyboardHandler != null) _keyboardHandler(0xE000 | raw.keyboard.MakeCode, true); @@ -423,13 +421,16 @@ case RawInput.RawKeyboardFlags.KeyE1: #if TRACE - Trace.WriteLine( String.Format("E1")); + Trace.WriteLine("E1"); #endif + if (_keyboardHandler != null) + _keyboardHandler(0xE100, true); + break; case RawInput.RawKeyboardFlags.KeyMake: #if TRACE - Trace.WriteLine( String.Format("Make: {0}", raw.keyboard.VKey)); + Trace.WriteLine(String.Format("Make: {0}", raw.keyboard.VKey)); #endif if (_keyboardHandler != null) @@ -439,13 +440,13 @@ case RawInput.RawKeyboardFlags.TerminalServerSetLED: #if TRACE - Trace.WriteLine( String.Format("TerminalServerSetLED")); + Trace.WriteLine("TerminalServerSetLED"); #endif break; case RawInput.RawKeyboardFlags.TerminalServerShadow: #if TRACE - Trace.WriteLine( String.Format("TerminalServerShadow")); + Trace.WriteLine("TerminalServerShadow"); #endif break; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -239,53 +239,7 @@ data = null; - StringBuilder irCode = new StringBuilder(4096); - _learnTimedOut = false; - - Timer timer = new Timer(); - timer.Interval = _learnTimeout; - timer.Tick += new EventHandler(timer_Tick); - timer.Enabled = true; - timer.Start(); - - try - { - _abortLearn = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Int32))); - Marshal.WriteInt32(_abortLearn, AllowLearn); - - result = UUIRTLearnIR( - _usbUirtHandle, // Handle to USB-UIRT - UUIRTDRV_IRFMT_PRONTO, - irCode, // Where to put the IR Code - null, // Learn status callback - IntPtr.Zero, // User data - _abortLearn, // Abort flag? - 0, - IntPtr.Zero, - IntPtr.Zero); - } - finally - { - Marshal.FreeHGlobal(_abortLearn); - _abortLearn = IntPtr.Zero; - } - - timer.Stop(); - - if (_learnTimedOut) - { - return LearnStatus.Timeout; - } - else if (result) - { - data = Encoding.ASCII.GetBytes(irCode.ToString()); - - return LearnStatus.Success; - } - else - { - return LearnStatus.Failure; - } + return LearnStatus.Failure; } /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-19 05:29:01 UTC (rev 1385) @@ -308,8 +308,7 @@ File "IR Server Plugins\IRTrans Transceiver\bin\Debug\*.*" File "IR Server Plugins\Microsoft MCE Transceiver\bin\Debug\*.*" File "IR Server Plugins\RedEye Blaster\bin\Debug\*.*" - File "IR Server Plugins\Serial IR Blaster\bin\Debug\*.*" - + File "IR Server Plugins\Serial IR Blaster\bin\Debug\*.*" File "IR Server Plugins\USB-UIRT Transceiver\bin\Debug\*.*" File "IR Server Plugins\Wii Remote Receiver\bin\Debug\*.*" File "IR Server Plugins\WiimoteLib\bin\Debug\*.*" Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -153,6 +153,11 @@ public void SetToCard(int cardId) { ExternalChannelConfig config = TV2BlasterPlugin.GetExternalChannelConfig(cardId); + if (config == null) + { + MessageBox.Show(this, "You must save your card configurations before copying between card setups", "No saved configration to copy from", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } // Setup command list. for (int i = 0; i < 10; i++) Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -160,6 +160,11 @@ public void SetToCard(int cardId) { ExternalChannelConfig config = TV3BlasterPlugin.GetExternalChannelConfig(cardId); + if (config == null) + { + MessageBox.Show(this, "You must save your card configurations before copying between card setups", "No saved configration to copy from", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } // Setup command list. for (int i = 0; i < 10; i++) Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-02-18 22:37:21 UTC (rev 1384) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-02-19 05:29:01 UTC (rev 1385) @@ -154,6 +154,11 @@ public void SetToCard(int cardId) { ExternalChannelConfig config = MCEReplacement.GetExternalChannelConfig(cardId); + if (config == null) + { + MessageBox.Show(this, "You must save your card configurations before copying between card setups", "No saved configration to copy from", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } // Setup command list. for (int i = 0; i < 10; i++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-23 10:54:30
|
Revision: 1391 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1391&view=rev Author: and-81 Date: 2008-02-23 02:54:21 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs 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/DeviceSelect.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150 Tuner.csproj trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150Tuner.exe.manifest trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Properties/ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest Removed Paths: ------------- trunk/plugins/IR Server Suite/Util Apps/Log File Multi-Viewer/ trunk/plugins/IR Server Suite/Util Apps/MacroConverter/ trunk/plugins/IR Server Suite/Util Apps/PVR150 Tuner/ trunk/plugins/IR Server Suite/Util Apps/SageSetup/ trunk/plugins/IR Server Suite/Util Apps/TestClient/ trunk/plugins/IR Server Suite/Util Apps/TestServer/ Property changes on: trunk/plugins/IR Server Suite/Applications/PVR150 Tuner ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150 Tuner.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150 Tuner.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150 Tuner.csproj 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,51 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{EDE4F0AC-CA13-4E4F-8466-EF0519B7B0EF}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>PVR150Tuner</RootNamespace> + <AssemblyName>PVR150Tuner</AssemblyName> + <StartupObject>PVR150Tuner.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="PVR150Tuner.exe.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150Tuner.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150Tuner.exe.manifest (rev 0) +++ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/PVR150Tuner.exe.manifest 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity version="1.0.4.2" processorArchitecture="X86" name="PVR150 Tuner" type="win32" /> + <description>Tune channels with Hauppauge IR Blaster built into PVR150 and compatible TV Cards</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> Added: trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Program.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,136 @@ +using System; +using System.Runtime.InteropServices; + +namespace PVR150Tuner +{ + + static class Program + { + + #region Interop + + [DllImport("hcwIRblast.dll")] + static extern ushort UIR_Open(uint bVerbose, ushort wIRPort); + + [DllImport("hcwIRblast.dll")] + static extern int UIR_Close(); + + [DllImport("hcwIRblast.dll")] + static extern int UIR_GetConfig(int device, int codeset, ref UIR_CFG cfgPtr); + + [DllImport("hcwIRblast.dll")] + static extern int UIR_GotoChannel(int device, int codeset, int channel); + + #endregion Interop + + #region Structures + + [StructLayout(LayoutKind.Sequential, Pack = 8)] + struct UIR_CFG + { + public int a; // 0x38; + public int b; + public int c; // Region + public int d; // Device + public int e; // Vendor + public int f; // Code Set + public int g; + public int h; + public int i; // Minimum Digits + public int j; // Digit Delay + public int k; // Need Enter + public int l; // Enter Delay + public int m; // Tune Delay + public int n; // One Digit Delay + } + + #endregion Structures + + #region Constants + + const int ReturnError = 1; + const int ReturnSuccess = 0; + + #endregion Constants + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static int Main(string[] args) + { + Console.WriteLine("PVR150 Tuner"); + Console.WriteLine(); + + if (args.Length != 1) + { + Console.WriteLine("Usage:"); + Console.WriteLine(" PVR150Tuner.exe <Channel Number>"); + Console.WriteLine(); + return ReturnError; + } + + bool deviceOpen = false; + + try + { + int channelNumber; + if (!int.TryParse(args[0], out channelNumber)) + throw new ApplicationException(String.Format("Failed to convert command line parameter ({0}) to channel number", args[0])); + + Console.WriteLine("Attempting to tune channel {0} ...", channelNumber); + Console.WriteLine(); + + int returnValue = UIR_Open(0, 0); + if (returnValue == 0) + throw new ApplicationException(String.Format("Failed to start device access ({0})", returnValue)); + else + deviceOpen = true; + + UIR_CFG config = new UIR_CFG(); + config.a = 0x38; + + returnValue = UIR_GetConfig(-1, -1, ref config); + if (returnValue == 0) + { + Console.WriteLine("Device configuration ..."); + Console.WriteLine(); + Console.WriteLine("Device: {0} Vendor: {1}", config.d, config.e); + Console.WriteLine("Region: {0} Code Set: {1}", config.c, config.f); + Console.WriteLine("Digit Delay: {0} Minimum Digits: {1}", config.j, config.i); + Console.WriteLine("One Digit Delay: {0} Tune Delay: {1}", config.n, config.m); + Console.WriteLine("Need Enter: {0} Enter Delay: {1}", config.k, config.l); + Console.WriteLine(); + } + else + { + throw new ApplicationException(String.Format("Failed to retrieve device configuration ({0})", returnValue)); + } + + returnValue = UIR_GotoChannel(config.d, config.f, channelNumber); + if (returnValue == 0) + throw new ApplicationException(String.Format("Failed to tune channel ({0})", returnValue)); + } + catch (ApplicationException ex) + { + Console.WriteLine("Error: {0}", ex.Message); + return ReturnError; + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return ReturnError; + } + finally + { + if (deviceOpen) + UIR_Close(); + } + + Console.WriteLine("Done."); + return ReturnSuccess; + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/PVR150 Tuner/Properties/AssemblyInfo.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PVR150 Tuner")] +[assembly: AssemblyDescription("Command line tuner for Hauppauge PVR-150 devices")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("PVR150 Tuner")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("57d8b7f1-678f-4169-80ba-e190dd01fba4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] Property changes on: trunk/plugins/IR Server Suite/Applications/SageSetup ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,248 @@ +namespace SageSetup +{ + + partial class FormMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.buttonSet = new System.Windows.Forms.Button(); + this.groupBoxIRBlast = new System.Windows.Forms.GroupBox(); + this.radioButtonConsole = new System.Windows.Forms.RadioButton(); + this.radioButtonWindowless = new System.Windows.Forms.RadioButton(); + this.groupBoxSagePlugin = new System.Windows.Forms.GroupBox(); + this.radioButtonExeTuner = new System.Windows.Forms.RadioButton(); + this.radioButtonExeMultiTuner = new System.Windows.Forms.RadioButton(); + this.groupBoxIRServer = new System.Windows.Forms.GroupBox(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.groupBoxChannelFormat = new System.Windows.Forms.GroupBox(); + this.checkBoxPad = new System.Windows.Forms.CheckBox(); + this.numericUpDownPad = new System.Windows.Forms.NumericUpDown(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.groupBoxIRBlast.SuspendLayout(); + this.groupBoxSagePlugin.SuspendLayout(); + this.groupBoxIRServer.SuspendLayout(); + this.groupBoxChannelFormat.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).BeginInit(); + this.SuspendLayout(); + // + // buttonSet + // + this.buttonSet.Location = new System.Drawing.Point(184, 312); + this.buttonSet.Name = "buttonSet"; + this.buttonSet.Size = new System.Drawing.Size(56, 24); + this.buttonSet.TabIndex = 4; + this.buttonSet.Text = "Set!"; + this.toolTips.SetToolTip(this.buttonSet, "Put the setttings in place"); + this.buttonSet.UseVisualStyleBackColor = true; + this.buttonSet.Click += new System.EventHandler(this.buttonSet_Click); + // + // groupBoxIRBlast + // + this.groupBoxIRBlast.Controls.Add(this.radioButtonWindowless); + this.groupBoxIRBlast.Controls.Add(this.radioButtonConsole); + this.groupBoxIRBlast.Location = new System.Drawing.Point(8, 96); + this.groupBoxIRBlast.Name = "groupBoxIRBlast"; + this.groupBoxIRBlast.Size = new System.Drawing.Size(232, 80); + this.groupBoxIRBlast.TabIndex = 1; + this.groupBoxIRBlast.TabStop = false; + this.groupBoxIRBlast.Text = "IR Blast"; + // + // radioButtonConsole + // + this.radioButtonConsole.AutoSize = true; + this.radioButtonConsole.Checked = true; + this.radioButtonConsole.Location = new System.Drawing.Point(8, 24); + this.radioButtonConsole.Name = "radioButtonConsole"; + this.radioButtonConsole.Size = new System.Drawing.Size(121, 17); + this.radioButtonConsole.TabIndex = 0; + this.radioButtonConsole.TabStop = true; + this.radioButtonConsole.Text = "Use console version"; + this.toolTips.SetToolTip(this.radioButtonConsole, "Use the console version of IR Blast"); + this.radioButtonConsole.UseVisualStyleBackColor = true; + // + // radioButtonWindowless + // + this.radioButtonWindowless.AutoSize = true; + this.radioButtonWindowless.Location = new System.Drawing.Point(8, 48); + this.radioButtonWindowless.Name = "radioButtonWindowless"; + this.radioButtonWindowless.Size = new System.Drawing.Size(138, 17); + this.radioButtonWindowless.TabIndex = 1; + this.radioButtonWindowless.Text = "Use windowless version"; + this.toolTips.SetToolTip(this.radioButtonWindowless, "Use the No Window version of IR Blast"); + this.radioButtonWindowless.UseVisualStyleBackColor = true; + // + // groupBoxSagePlugin + // + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeMultiTuner); + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeTuner); + this.groupBoxSagePlugin.Location = new System.Drawing.Point(8, 8); + this.groupBoxSagePlugin.Name = "groupBoxSagePlugin"; + this.groupBoxSagePlugin.Size = new System.Drawing.Size(232, 80); + this.groupBoxSagePlugin.TabIndex = 0; + this.groupBoxSagePlugin.TabStop = false; + this.groupBoxSagePlugin.Text = "Sage Plugin"; + // + // radioButtonExeTuner + // + this.radioButtonExeTuner.AutoSize = true; + this.radioButtonExeTuner.Checked = true; + this.radioButtonExeTuner.Location = new System.Drawing.Point(8, 24); + this.radioButtonExeTuner.Name = "radioButtonExeTuner"; + this.radioButtonExeTuner.Size = new System.Drawing.Size(96, 17); + this.radioButtonExeTuner.TabIndex = 0; + this.radioButtonExeTuner.TabStop = true; + this.radioButtonExeTuner.Text = "Use EXETuner"; + this.toolTips.SetToolTip(this.radioButtonExeTuner, "Use the Sage EXE Tuner plugin"); + this.radioButtonExeTuner.UseVisualStyleBackColor = true; + // + // radioButtonExeMultiTuner + // + this.radioButtonExeMultiTuner.AutoSize = true; + this.radioButtonExeMultiTuner.Location = new System.Drawing.Point(8, 48); + this.radioButtonExeMultiTuner.Name = "radioButtonExeMultiTuner"; + this.radioButtonExeMultiTuner.Size = new System.Drawing.Size(118, 17); + this.radioButtonExeMultiTuner.TabIndex = 1; + this.radioButtonExeMultiTuner.Text = "Use EXEMultiTuner"; + this.toolTips.SetToolTip(this.radioButtonExeMultiTuner, "Use the Sage EXE Multi Tuner plugin"); + this.radioButtonExeMultiTuner.UseVisualStyleBackColor = true; + // + // groupBoxIRServer + // + this.groupBoxIRServer.Controls.Add(this.comboBoxComputer); + this.groupBoxIRServer.Location = new System.Drawing.Point(8, 184); + this.groupBoxIRServer.Name = "groupBoxIRServer"; + this.groupBoxIRServer.Size = new System.Drawing.Size(232, 56); + this.groupBoxIRServer.TabIndex = 2; + this.groupBoxIRServer.TabStop = false; + this.groupBoxIRServer.Text = "IR Server"; + // + // comboBoxComputer + // + this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxComputer.FormattingEnabled = true; + this.comboBoxComputer.Location = new System.Drawing.Point(8, 24); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(216, 21); + this.comboBoxComputer.TabIndex = 0; + this.toolTips.SetToolTip(this.comboBoxComputer, "Host computer for IR Server"); + // + // groupBoxChannelFormat + // + this.groupBoxChannelFormat.Controls.Add(this.numericUpDownPad); + this.groupBoxChannelFormat.Controls.Add(this.checkBoxPad); + this.groupBoxChannelFormat.Location = new System.Drawing.Point(8, 248); + this.groupBoxChannelFormat.Name = "groupBoxChannelFormat"; + this.groupBoxChannelFormat.Size = new System.Drawing.Size(232, 56); + this.groupBoxChannelFormat.TabIndex = 3; + this.groupBoxChannelFormat.TabStop = false; + this.groupBoxChannelFormat.Text = "Channel Format"; + // + // checkBoxPad + // + this.checkBoxPad.Location = new System.Drawing.Point(8, 24); + this.checkBoxPad.Name = "checkBoxPad"; + this.checkBoxPad.Size = new System.Drawing.Size(144, 20); + this.checkBoxPad.TabIndex = 0; + this.checkBoxPad.Text = "Pad channel number"; + this.toolTips.SetToolTip(this.checkBoxPad, "Do you want to pad channel numbers?"); + this.checkBoxPad.UseVisualStyleBackColor = true; + // + // numericUpDownPad + // + this.numericUpDownPad.Location = new System.Drawing.Point(152, 24); + this.numericUpDownPad.Maximum = new decimal(new int[] { + 9, + 0, + 0, + 0}); + this.numericUpDownPad.Minimum = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.numericUpDownPad.Name = "numericUpDownPad"; + this.numericUpDownPad.Size = new System.Drawing.Size(72, 20); + this.numericUpDownPad.TabIndex = 1; + this.numericUpDownPad.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.numericUpDownPad, "Pad out channel numbers to this many digits"); + this.numericUpDownPad.Value = new decimal(new int[] { + 4, + 0, + 0, + 0}); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(248, 344); + this.Controls.Add(this.groupBoxChannelFormat); + this.Controls.Add(this.groupBoxIRServer); + this.Controls.Add(this.groupBoxSagePlugin); + this.Controls.Add(this.groupBoxIRBlast); + this.Controls.Add(this.buttonSet); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormMain"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "IR Server - Sage Setup"; + this.Load += new System.EventHandler(this.FormMain_Load); + this.groupBoxIRBlast.ResumeLayout(false); + this.groupBoxIRBlast.PerformLayout(); + this.groupBoxSagePlugin.ResumeLayout(false); + this.groupBoxSagePlugin.PerformLayout(); + this.groupBoxIRServer.ResumeLayout(false); + this.groupBoxChannelFormat.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonSet; + private System.Windows.Forms.GroupBox groupBoxIRBlast; + private System.Windows.Forms.RadioButton radioButtonWindowless; + private System.Windows.Forms.RadioButton radioButtonConsole; + private System.Windows.Forms.GroupBox groupBoxSagePlugin; + private System.Windows.Forms.RadioButton radioButtonExeMultiTuner; + private System.Windows.Forms.RadioButton radioButtonExeTuner; + private System.Windows.Forms.GroupBox groupBoxIRServer; + private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.GroupBox groupBoxChannelFormat; + private System.Windows.Forms.CheckBox checkBoxPad; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.NumericUpDown numericUpDownPad; + } + +} + Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,120 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using Microsoft.Win32; +using IrssUtils; + +namespace SageSetup +{ + + /// <summary> + /// Main Sage Setup form. + /// </summary> + public partial class FormMain : Form + { + + string _irBlastLocation = null; + + /// <summary> + /// Initializes a new instance of the <see cref="FormMain"/> class. + /// </summary> + public FormMain() + { + InitializeComponent(); + } + + private void FormMain_Load(object sender, EventArgs e) + { + List<string> networkPCs = Network.GetComputers(false); + if (networkPCs == null) + { + MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + else + { + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + } + + _irBlastLocation = SystemRegistry.GetInstallFolder(); + + if (String.IsNullOrEmpty(_irBlastLocation)) + { + MessageBox.Show(this, "IR Server Suite install location not found, please re-install IR Server Suite", "Application Location Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + } + + private void buttonSet_Click(object sender, EventArgs e) + { +/* +[HKEY_LOCAL_MACHINE\SOFTWARE\Sage\EXETunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -channel %CHANNEL%" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common\EXEMultiTunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -port Port_%DEVICE% -channel %CHANNEL%" +*/ + string hostComputer = comboBoxComputer.Text; + + if (String.IsNullOrEmpty(hostComputer)) + { + MessageBox.Show(this, "You must specify an IR Server host computer", "No Server Host", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + RegistryKey mainKey = null; + + try + { + if (radioButtonExeTuner.Checked) + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Sage\\EXETunerPlugin"); + else + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Frey Technologies\\Common\\EXEMultiTunerPlugin"); + + StringBuilder command = new StringBuilder(); + command.Append("\""); + command.Append(_irBlastLocation); + command.Append("\\IR Blast\\"); + if (radioButtonConsole.Checked) + command.Append("IRBlast.exe"); + else + command.Append("IRBlast-NoWindow.exe"); + command.Append("\""); + + command.Append(" -host "); + command.Append(hostComputer); + + if (radioButtonExeMultiTuner.Checked) + command.Append(" -port Port_%DEVICE%"); + + if (checkBoxPad.Checked) + command.AppendFormat(" -pad {0}", numericUpDownPad.Value); + + command.Append(" -channel %CHANNEL%"); + + mainKey.SetValue("Command", command.ToString(), RegistryValueKind.String); + + MessageBox.Show(this, "Sage plugin setup complete", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + finally + { + if (mainKey != null) + mainKey.Close(); + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace SageSetup +{ + + static class Program + { + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR Server - Sage Setup")] +[assembly: AssemblyDescription("Setup the Sage EXE Tuner plugins for use with IR Server Suite")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("SageSetup")] +[assembly: AssemblyCopyright("Copyright © Aaron Dinnage, 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("98cabc3d-5464-4122-aa78-483535991e02")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,98 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{905131F8-F8AC-4A65-A722-37783902D7B8}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SageSetup</RootNamespace> + <AssemblyName>SageSetup</AssemblyName> + <StartupObject>SageSetup.Program</StartupObject> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>none</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + <DocumentationFile> + </DocumentationFile> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="SageSetup.exe.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest 2008-02-23 10:54:21 UTC (rev 1391) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity version="1.0.4.2" processorArchitecture="X86" name="SageSetup" type="win32" /> + <description>Setup the Sage EXE Tuner plugins for use with IR Server Suite</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -336,6 +336,7 @@ this.labelProgramsDelete.TabIndex = 2; this.labelProgramsDelete.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.toolTip.SetToolTip(this.labelProgramsDelete, "Remove program"); + this.labelProgramsDelete.Click += new System.EventHandler(this.labelProgramsDelete_Click); // // labelProgramsEdit // @@ -348,6 +349,7 @@ this.labelProgramsEdit.TabIndex = 1; this.labelProgramsEdit.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.toolTip.SetToolTip(this.labelProgramsEdit, "Edit program"); + this.labelProgramsEdit.Click += new System.EventHandler(this.labelProgramsEdit_Click); // // labelProgramsAdd // @@ -360,6 +362,7 @@ this.labelProgramsAdd.TabIndex = 0; this.labelProgramsAdd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.toolTip.SetToolTip(this.labelProgramsAdd, "Add program"); + this.labelProgramsAdd.Click += new System.EventHandler(this.labelProgramsAdd_Click); // // toolStripButtonMappings // @@ -737,7 +740,7 @@ // this.checkBoxAutoRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBoxAutoRun.AutoSize = true; - this.checkBoxAutoRun.Location = new System.Drawing.Point(16, 440); + this.checkBoxAutoRun.Location = new System.Drawing.Point(8, 448); this.checkBoxAutoRun.Name = "checkBoxAutoRun"; this.checkBoxAutoRun.Size = new System.Drawing.Size(167, 17); this.checkBoxAutoRun.TabIndex = 2; @@ -861,15 +864,15 @@ this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(544, 472); + this.ClientSize = new System.Drawing.Size(544, 473); this.Controls.Add(this.tabControl); - this.Controls.Add(this.checkBoxAutoRun); this.Controls.Add(this.menuStrip); this.Controls.Add(this.buttonOK); + this.Controls.Add(this.checkBoxAutoRun); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(472, 448); + this.MinimumSize = new System.Drawing.Size(552, 480); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Translator"; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -1382,6 +1382,44 @@ } } + private void labelProgramsAdd_Click(object sender, EventArgs e) + { + AddProgram(); + } + private void labelProgramsEdit_Click(object sender, EventArgs e) + { + if (listViewPrograms.SelectedItems.Count == 0) + return; + + string selectedItem = listViewPrograms.SelectedItems[0].Text; + + EditProgram(selectedItem); + } + private void labelProgramsDelete_Click(object sender, EventArgs e) + { + if (listViewPrograms.SelectedItems.Count == 0) + return; + + string selectedItem = listViewPrograms.SelectedItems[0].Text; + + string message = String.Format("Are you sure you want to remove all mappings for {0}?", selectedItem); + string caption = String.Format("Remove {0}?", selectedItem); + + if (MessageBox.Show(this, message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + foreach (ProgramSettings progSettings in Program.Config.Programs) + { + if (progSettings.Name.Equals(selectedItem)) + { + Program.Config.Programs.Remove(progSettings); + break; + } + } + + RefreshProgramList(); + } + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -868,11 +868,11 @@ } static void MouseHandlerCallback(int deltaX, int deltaY, int buttons) { + if (deltaX != 0 || deltaY != 0) + Mouse.Move(deltaX, deltaY, false); + if (buttons != (int)Mouse.MouseEvents.None) Mouse.Button((Mouse.MouseEvents)buttons); - - if (deltaX != 0 || deltaY != 0) - Mouse.Move(deltaX, deltaY, false); } static void MapEvent(MappingEvent theEvent) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -886,6 +886,7 @@ /// Get a list of commands found in the Command Libraries. /// </summary> /// <returns>Available commands.</returns> + /* public static Type[] GetLibraryCommands() { try @@ -936,7 +937,7 @@ return null; } } - + */ /// <summary> /// Returns a list of IR Commands. /// </summary> Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2008-02-23 10:54:21 UTC (rev 1391) @@ -360,12 +360,6 @@ <Content Include="Graphics\TopLeft.png" /> <Content Include="Graphics\TopRight.png" /> </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\Commands\Command\Command.csproj"> - <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> - <Name>Command</Name> - </ProjectReference> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -37,6 +37,8 @@ this.numericUpDownInputByteMask = new System.Windows.Forms.NumericUpDown(); this.labelRepeatDelay = new System.Windows.Forms.Label(); this.numericUpDownRepeatDelay = new System.Windows.Forms.NumericUpDown(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownInputByte)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownInputByteMask)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).BeginInit(); @@ -52,7 +54,7 @@ 0}); this.numericUpDownInputByte.Name = "numericUpDownInputByte"; this.numericUpDownInputByte.Size = new System.Drawing.Size(56, 20); - this.numericUpDownInputByte.TabIndex = 0; + this.numericUpDownInputByte.TabIndex = 1; this.numericUpDownInputByte.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // labelInputByte @@ -60,7 +62,7 @@ this.labelInputByte.Location = new System.Drawing.Point(8, 8); this.labelInputByte.Name = "labelInputByte"; this.labelInputByte.Size = new System.Drawing.Size(104, 20); - this.labelInputByte.TabIndex = 1; + this.labelInputByte.TabIndex = 0; this.labelInputByte.Text = "Input byte:"; this.labelInputByte.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -70,7 +72,7 @@ this.checkBoxUseAllBytes.Location = new System.Drawing.Point(8, 72); this.checkBoxUseAllBytes.Name = "checkBoxUseAllBytes"; this.checkBoxUseAllBytes.Size = new System.Drawing.Size(112, 17); - this.checkBoxUseAllBytes.TabIndex = 2; + this.checkBoxUseAllBytes.TabIndex = 4; this.checkBoxUseAllBytes.Text = "Use all input bytes"; this.checkBoxUseAllBytes.UseVisualStyleBackColor = true; // @@ -79,7 +81,7 @@ this.labelInputByteMask.Location = new System.Drawing.Point(8, 40); this.labelInputByteMask.Name = "labelInputByteMask"; this.labelInputByteMask.Size = new System.Drawing.Size(104, 20); - this.labelInputByteMask.TabIndex = 4; + this.labelInputByteMask.TabIndex = 2; this.labelInputByteMask.Text = "Input byte mask:"; this.labelInputByteMask.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -101,7 +103,7 @@ this.labelRepeatDelay.Location = new System.Drawing.Point(8, 104); this.labelRepeatDelay.Name = "labelRepeatDelay"; this.labelRepeatDelay.Size = new System.Drawing.Size(104, 20); - this.labelRepeatDelay.TabIndex = 6; + this.labelRepeatDelay.TabIndex = 5; this.labelRepeatDelay.Text = "Repeat delay:"; this.labelRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -115,14 +117,41 @@ 0}); this.numericUpDownRepeatDelay.Name = "numericUpDownRepeatDelay"; this.numericUpDownRepeatDelay.Size = new System.Drawing.Size(56, 20); - this.numericUpDownRepeatDelay.TabIndex = 5; + this.numericUpDownRepeatDelay.TabIndex = 6; this.numericUpDownRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // + // 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(32, 144); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 7; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(104, 144); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 8; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // // AdvancedSettings // + this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(176, 137); + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(176, 177); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); this.Controls.Add(this.labelRepeatDelay); this.Controls.Add(this.numericUpDownRepeatDelay); this.Controls.Add(this.labelInputByteMask); @@ -130,8 +159,10 @@ this.Controls.Add(this.checkBoxUseAllBytes); this.Controls.Add(this.labelInputByte); this.Controls.Add(this.numericUpDownInputByte); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(182, 202); this.Name = "AdvancedSettings"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -153,6 +184,8 @@ private System.Windows.Forms.NumericUpDown numericUpDownInputByteMask; private System.Windows.Forms.Label labelRepeatDelay; private System.Windows.Forms.NumericUpDown numericUpDownRepeatDelay; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -12,11 +12,44 @@ internal partial class AdvancedSettings : Form { + public int InputByte + { + get { return decimal.ToInt32(numericUpDownInputByte.Value); } + set { numericUpDownInputByte.Value = new decimal(value); } + } + public byte ByteMask + { + get { return decimal.ToByte(numericUpDownInputByteMask.Value); } + set { numericUpDownInputByteMask.Value = new decimal(value); } + } + public bool UseAllBytes + { + get { return checkBoxUseAllBytes.Checked; } + set { checkBoxUseAllBytes.Checked = value; } + } + public int RepeatDelay + { + get { return decimal.ToInt32(numericUpDownRepeatDelay.Value); } + set { numericUpDownRepeatDelay.Value = new decimal(value); } + } + public AdvancedSettings() { InitializeComponent(); } + 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(); + } + } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-22 21:54:13 UTC (rev 1390) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-23 10:54:21 UTC (rev 1391) @@ -162,12 +162,21 @@ { LoadSettings(); - DeviceSelect deviceSelect = new DeviceSelect(); + DeviceSelect deviceSelect = new DeviceSelect(); deviceSelect.SelectedDevice = _device; + deviceSelect.InputByte = _inputByte; + deviceSelect.ByteMask = _byteMask; + deviceSelect.UseAllBytes = _useAllBytes; + deviceSelect.RepeatDelay = _repeatDelay; if (deviceSelect.ShowDialog(owner) == DialogResult.OK) { - _device = deviceSelect.SelectedDevice; + _device = deviceSelect.SelectedDevice; + _inputByte = deviceSelect.InputByte; + _byteMask = deviceSelect.ByteMask; + _useAllBytes = deviceSelect.UseAllBytes; + _repeatDelay = deviceSelect.RepeatDelay; + SaveSettings(); } } @@ -363,6 +372,12 @@ string code = BitConverter.ToString(newArray); + if (!_useAllBytes) + { + int val = newArray[_inputByte] & _byteMask; + code = String.Format("{0:X2}", val); + } + #if TRACE Trace.WriteLine(code); #endif @@ -414,8 +429,8 @@ #if TRACE Trace.WriteLine(String.Format("E0: {0}", raw.keyboard.MakeCode)); #endif - if (_keyboardHandler != null) - _keyboardHandler(0xE000 | raw.keyboard.MakeCode, true); + //if (_keyboardHandler != null) + //_keyboardHandler(0xE000 | raw.keyboard.MakeCode, true); break; @@ -423,8 +438,8 @@ #if TRACE Trace.WriteLine("E1"); #endif - if (_keyboardHandler != null) - _keyboardHandler(0xE100, true); + //if (_keyboardHandler != n... [truncated message content] |
From: <an...@us...> - 2008-02-24 07:08:50
|
Revision: 1393 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1393&view=rev Author: and-81 Date: 2008-02-23 23:08:47 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,59 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C7BF555E-638F-4E1B-9D5A-D2D226C77676}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>IR501 Receiver</AssemblyName> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\IR501 Receiver.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IR501Receiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="Icon.ico" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,379 @@ +using System; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Runtime.InteropServices; + +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server Plugin for the IR501 IR receiver. + /// </summary> + [CLSCompliant(false)] + public class IR501Receiver : PluginBase, IRemoteReceiver + { + + #region Interop + + [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + String fileName, + [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShare fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, + [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, + IntPtr template); + + [Flags] + enum EFileAttributes : uint + { + Readonly = 0x00000001, + Hidden = 0x00000002, + System = 0x00000004, + Directory = 0x00000010, + Archive = 0x00000020, + Device = 0x00000040, + Normal = 0x00000080, + Temporary = 0x00000100, + SparseFile = 0x00000200, + ReparsePoint = 0x00000400, + Compressed = 0x00000800, + Offline = 0x00001000, + NotContentIndexed = 0x00002000, + Encrypted = 0x00004000, + Write_Through = 0x80000000, + Overlapped = 0x40000000, + NoBuffering = 0x20000000, + RandomAccess = 0x10000000, + SequentialScan = 0x08000000, + DeleteOnClose = 0x04000000, + BackupSemantics = 0x02000000, + PosixSemantics = 0x01000000, + OpenReparsePoint = 0x00200000, + OpenNoRecall = 0x00100000, + FirstPipeInstance = 0x00080000, + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInfoData + { + public int Size; + public Guid Class; + public uint DevInst; + public IntPtr Reserved; + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInterfaceData + { + public int Size; + public Guid Class; + public uint Flags; + public uint Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct DeviceInterfaceDetailData + { + public int Size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string DevicePath; + } + + [DllImport("hid")] + static extern void HidD_GetHidGuid( + ref Guid guid); + + [DllImport("setupapi", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid ClassGuid, + [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, + IntPtr hwndParent, + UInt32 Flags); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int Index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInterfaces( + IntPtr handle, + ref DeviceInfoData deviceInfoData, + ref Guid guidClass, + int MemberIndex, + ref DeviceInterfaceData deviceInterfaceData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + IntPtr unused1, + int unused2, + ref uint requiredSize, + IntPtr unused3); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + ref DeviceInterfaceDetailData deviceInterfaceDetailData, + uint detailSize, + IntPtr unused1, + IntPtr unused2); + + [DllImport("setupapi")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); + + #endregion Interop + + #region Constants + + const int DeviceBufferSize = 4; + + const string DeviceID = "vid_147a&pid_e001"; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler; + + FileStream _deviceStream; + byte[] _deviceBuffer; + + int _lastCode = -1; + DateTime _lastCodeTime = DateTime.Now; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "IR501"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Support for the IR501 IR Receiver"; } } + + /// <summary> + /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// </summary> + /// <returns> + /// <c>true</c> if the device is present, otherwise <c>false</c>. + /// </returns> + public override bool Detect() + { + try + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + + return (devicePath != null); + } + catch + { + return false; + } + } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + if (String.IsNullOrEmpty(devicePath)) + throw new ApplicationException("Device not found"); + + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + + if (deviceHandle.IsInvalid) + throw new Win32Exception(lastError, "Failed to open device"); + + //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); + + _deviceBuffer = new byte[DeviceBufferSize]; + _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + Stop(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Start(); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + if (_deviceStream == null) + return; + + try + { + _deviceStream.Dispose(); + } + catch (IOException) + { + // we are closing the stream so ignore this + } + finally + { + _deviceStream = null; + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + static string FindDevice(Guid classGuid) + { + int lastError; + + // 0x12 = DIGCF_PRESENT | DIGCF_DEVICEINTERFACE + IntPtr handle = SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); + lastError = Marshal.GetLastWin32Error(); + + if (handle.ToInt32() == -1) + throw new Win32Exception(lastError); + + string devicePath = null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) + { + // out of devices or do we have an error? + lastError = Marshal.GetLastWin32Error(); + if (lastError != 0x0103 && lastError != 0x007E) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); + deviceInterfaceDetailData.Size = 5; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (deviceInterfaceDetailData.DevicePath.IndexOf(DeviceID, StringComparison.InvariantCultureIgnoreCase) != -1) + { + SetupDiDestroyDeviceInfoList(handle); + devicePath = deviceInterfaceDetailData.DevicePath; + break; + } + } + + return devicePath; + } + + void OnReadComplete(IAsyncResult asyncResult) + { + try + { + if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + { + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + int keyCode = (int)_deviceBuffer[2]; + + if (keyCode != _lastCode || timeSpan.Milliseconds > 250) + { + if (_remoteButtonHandler != null) + _remoteButtonHandler(keyCode.ToString()); + + _lastCodeTime = DateTime.Now; + } + + _lastCode = keyCode; + } + + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + catch (Exception) + { + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,39 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR501 Receiver")] +[assembly: AssemblyDescription("Support for the IR501 IR receiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("IR501 Receiver")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] +[assembly: Guid("733bd6d4-9188-4f52-9bc4-9cc03deaef17")] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,59 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>IR507 Receiver</AssemblyName> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\IR507 Receiver.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IR507Receiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="Icon.ico" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,379 @@ +using System; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Runtime.InteropServices; + +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server Plugin for the IR507 IR receiver. + /// </summary> + [CLSCompliant(false)] + public class IR507Receiver : PluginBase, IRemoteReceiver + { + + #region Interop + + [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + String fileName, + [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShare fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, + [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, + IntPtr template); + + [Flags] + enum EFileAttributes : uint + { + Readonly = 0x00000001, + Hidden = 0x00000002, + System = 0x00000004, + Directory = 0x00000010, + Archive = 0x00000020, + Device = 0x00000040, + Normal = 0x00000080, + Temporary = 0x00000100, + SparseFile = 0x00000200, + ReparsePoint = 0x00000400, + Compressed = 0x00000800, + Offline = 0x00001000, + NotContentIndexed = 0x00002000, + Encrypted = 0x00004000, + Write_Through = 0x80000000, + Overlapped = 0x40000000, + NoBuffering = 0x20000000, + RandomAccess = 0x10000000, + SequentialScan = 0x08000000, + DeleteOnClose = 0x04000000, + BackupSemantics = 0x02000000, + PosixSemantics = 0x01000000, + OpenReparsePoint = 0x00200000, + OpenNoRecall = 0x00100000, + FirstPipeInstance = 0x00080000, + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInfoData + { + public int Size; + public Guid Class; + public uint DevInst; + public IntPtr Reserved; + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInterfaceData + { + public int Size; + public Guid Class; + public uint Flags; + public uint Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct DeviceInterfaceDetailData + { + public int Size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string DevicePath; + } + + [DllImport("hid")] + static extern void HidD_GetHidGuid( + ref Guid guid); + + [DllImport("setupapi", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid ClassGuid, + [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, + IntPtr hwndParent, + UInt32 Flags); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int Index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInterfaces( + IntPtr handle, + ref DeviceInfoData deviceInfoData, + ref Guid guidClass, + int MemberIndex, + ref DeviceInterfaceData deviceInterfaceData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + IntPtr unused1, + int unused2, + ref uint requiredSize, + IntPtr unused3); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + ref DeviceInterfaceDetailData deviceInterfaceDetailData, + uint detailSize, + IntPtr unused1, + IntPtr unused2); + + [DllImport("setupapi")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); + + #endregion Interop + + #region Constants + + const int DeviceBufferSize = 4; + + const string DeviceID = "vid_0e6a&pid_6002"; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler; + + FileStream _deviceStream; + byte[] _deviceBuffer; + + int _lastCode = -1; + DateTime _lastCodeTime = DateTime.Now; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "IR507"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Support for the IR507 IR Receiver"; } } + + /// <summary> + /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// </summary> + /// <returns> + /// <c>true</c> if the device is present, otherwise <c>false</c>. + /// </returns> + public override bool Detect() + { + try + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + + return (devicePath != null); + } + catch + { + return false; + } + } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + if (String.IsNullOrEmpty(devicePath)) + throw new ApplicationException("Device not found"); + + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + + if (deviceHandle.IsInvalid) + throw new Win32Exception(lastError, "Failed to open device"); + + //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); + + _deviceBuffer = new byte[DeviceBufferSize]; + _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + Stop(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Start(); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + if (_deviceStream == null) + return; + + try + { + _deviceStream.Dispose(); + } + catch (IOException) + { + // we are closing the stream so ignore this + } + finally + { + _deviceStream = null; + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + static string FindDevice(Guid classGuid) + { + int lastError; + + // 0x12 = DIGCF_PRESENT | DIGCF_DEVICEINTERFACE + IntPtr handle = SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); + lastError = Marshal.GetLastWin32Error(); + + if (handle.ToInt32() == -1) + throw new Win32Exception(lastError); + + string devicePath = null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) + { + // out of devices or do we have an error? + lastError = Marshal.GetLastWin32Error(); + if (lastError != 0x0103 && lastError != 0x007E) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); + deviceInterfaceDetailData.Size = 5; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (deviceInterfaceDetailData.DevicePath.IndexOf(DeviceID, StringComparison.InvariantCultureIgnoreCase) != -1) + { + SetupDiDestroyDeviceInfoList(handle); + devicePath = deviceInterfaceDetailData.DevicePath; + break; + } + } + + return devicePath; + } + + void OnReadComplete(IAsyncResult asyncResult) + { + try + { + if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + { + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + int keyCode = (int)_deviceBuffer[2]; + + if (keyCode != _lastCode || timeSpan.Milliseconds > 250) + { + if (_remoteButtonHandler != null) + _remoteButtonHandler(keyCode.ToString()); + + _lastCodeTime = DateTime.Now; + } + + _lastCode = keyCode; + } + + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + catch (Exception) + { + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,39 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR507 Receiver")] +[assembly: AssemblyDescription("Support for the IR507 IR receiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("IR507 Receiver")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] +[assembly: Guid("7b404b6c-e5a5-4d76-b5b6-d71dfd7696fb")] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -5,11 +5,12 @@ <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MicrosoftMceTransceiver</RootNamespace> <AssemblyName>Microsoft MCE Transceiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <StartupObject>InputService.Plugin.MicrosoftMceTransceiver</StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -98,7 +99,7 @@ <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> - <Private>False</Private> + <Private>True</Private> </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -48,10 +48,126 @@ /// <summary> /// IR Server Plugin for Microsoft MCE Transceiver device. /// </summary> - public class MicrosoftMceTransceiver : - PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver + public class MicrosoftMceTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver { + #region Debug + + static void xRemote(string code) + { + Console.WriteLine("Remote: {0}", code); + } + static void xKeyboard(int button, bool up) + { + Console.WriteLine("Keyboard: {0}, {1}", button, up); + } + static void xMouse(int x, int y, int buttons) + { + Console.WriteLine("Mouse: ({0}, {1}) - {2}", x, y, buttons); + } + + static void Dump(int[] timingData) + { + foreach (int time in timingData) + Console.Write("{0}, ", time); + Console.WriteLine(); + } + + [STAThread] + static void Main() + { + MicrosoftMceTransceiver c = new MicrosoftMceTransceiver(); + + //c.Configure(null); + + c.RemoteCallback += new RemoteHandler(xRemote); + c.KeyboardCallback += new KeyboardHandler(xKeyboard); + c.MouseCallback += new MouseHandler(xMouse); + + c.Start(); + + //Application.Run(); + + byte[] fileBytes; + string fileName = @"C:\test2.IR"; + /* + if (c.Learn(out fileBytes) == LearnStatus.Success) + { + using (FileStream writeFile = File.OpenWrite(fileName)) + { + writeFile.Write(fileBytes, 0, fileBytes.Length); + } + } + */ + Console.WriteLine("Testing IR longest length without crashing receiver"); + + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); + + fileBytes = new byte[file.Length]; + file.Read(fileBytes, 0, (int)file.Length); + } + + IrCode code = IrCode.FromByteArray(fileBytes); + Dump(code.TimingData); + + + Console.WriteLine("Press any key to begin ..."); + Console.ReadKey(); + + int length = 750000; + //for (int length = 700000; length < 5000000; length += 50000) + while (true) + { + Console.WriteLine("Blasting with approx. total time of {0}us ...", length); + + List<int> newCode = new List<int>(); + + int total = 0; + for (int index = 0; index < code.TimingData.Length; index++) + { + int time = code.TimingData[index]; + + if (total + Math.Abs(time) >= length) + { + if (time > 0) + { + break; + } + else + { + time = total - length; + } + } + + newCode.Add(time); + total += Math.Abs(time); + } + + Console.WriteLine("Blasting with actual total time of {0}us ...", total); + + IrCode test = new IrCode(code.Carrier, newCode.ToArray()); + Dump(test.TimingData); + + c.Transmit("Both", test.ToByteArray(true)); + + Console.WriteLine("Blast complete, press any key to contiue ..."); + if (Console.ReadKey().Key == ConsoleKey.Escape) + break; + } + + Console.WriteLine("Done"); + + c.Stop(); + c = null; + } + + #endregion Debug + + + #region Constants static readonly string ConfigurationFile = Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -144,7 +144,9 @@ const int DeviceBufferSize = 4; const string DeviceID = "vid_147a&pid_e019"; - + //const string DeviceID = "vid_147a&pid_e001"; // 501 + //const string DeviceID = "vid_0e6a&pid_6002"; // 507 + #endregion Constants #region Variables @@ -180,7 +182,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "Support for RC102 and compatible IR receivers"; } } + public override string Description { get { return "Support for RC102 remote receiver"; } } /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-24 07:08:47 UTC (rev 1393) @@ -407,6 +407,18 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR501 Receiver", "IR Server Plugins\IR501 Receiver\IR501 Receiver.csproj", "{C7BF555E-638F-4E1B-9D5A-D2D226C77676}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR507 Receiver", "IR Server Plugins\IR507 Receiver\IR507 Receiver.csproj", "{1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1019,6 +1031,24 @@ {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|Any CPU.Build.0 = Release|Any CPU {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|x86.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|x86.ActiveCfg = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|Any CPU.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|Any CPU.Build.0 = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|x86.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|Any CPU.Build.0 = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|x86.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|x86.ActiveCfg = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|Any CPU.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|Any CPU.Build.0 = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|x86.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|Any CPU.Build.0 = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1064,6 +1094,8 @@ {ABA2DAF3-B4CF-42BF-8686-DD662B0D6406} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {A2702ACF-C59E-4564-8A4A-5CBFF21C1E66} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {C7BF555E-638F-4E1B-9D5A-D2D226C77676} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {CD395FC2-70E2-42C4-8A20-5469A0C5EB50} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -846,8 +846,7 @@ { Log.Debug("MESSAGE RECEIVED: {0}", Enum.GetName(typeof(GUIMessage.MessageType), msg.Message)); - if (EventMapperEnabled) - MapEvent(msg); + MapEvent(msg); } /// <summary> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -405,6 +405,7 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new string[] { msg.Label, msg.Label2 }); } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -368,6 +368,7 @@ Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new int[] { analogChannel.ChannelNumber, tvEvent.Card.Id }); } Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -933,6 +933,7 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new string[] { msg.Label, msg.Label2 }); } @@ -1014,7 +1015,7 @@ if (card < 0) { card = _externalChannelConfigs[0].CardId; - Log.Warn("TV2BlasterPlugin: MediaPortal reports invalid TV Card ID ({0}), using STB settings for first TV Card ({1})", data[1], card); + Log.Warn("MCEReplacement: MediaPortal reports invalid TV Card ID ({0}), using STB settings for first TV Card ({1})", data[1], card); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-28 06:41:37
|
Revision: 1402 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1402&view=rev Author: and-81 Date: 2008-02-27 22:41:36 -0800 (Wed, 27 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Documentation/Translator/index.html trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.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/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Abstractor/ trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.resx trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/ trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsc trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsd trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xss Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,93 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{66F37FF9-0398-4954-812D-065C2D153746}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Abstractor</RootNamespace> + <AssemblyName>Abstractor</AssemblyName> + <StartupObject>Abstractor.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="MainForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MainForm.Designer.cs"> + <DependentUpon>MainForm.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="MainForm.resx"> + <SubType>Designer</SubType> + <DependentUpon>MainForm.cs</DependentUpon> + </EmbeddedResource> + <None Include="RemoteTable.xsc"> + <DependentUpon>RemoteTable.xsd</DependentUpon> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Include="RemoteTable.xsd"> + <Generator>MSDataSetGenerator</Generator> + <LastGenOutput>RemoteTable.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <None Include="RemoteTable.xss"> + <DependentUpon>RemoteTable.xsd</DependentUpon> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </None> + <Compile Include="RemoteTable.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>RemoteTable.xsd</DependentUpon> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,308 @@ +namespace Abstractor +{ + partial class MainForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.groupBoxSetup = new System.Windows.Forms.GroupBox(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.labelServerAddress = new System.Windows.Forms.Label(); + this.buttonConnect = new System.Windows.Forms.Button(); + this.buttonDisconnect = new System.Windows.Forms.Button(); + this.groupBoxStatus = new System.Windows.Forms.GroupBox(); + this.listBoxStatus = new System.Windows.Forms.ListBox(); + this.groupBoxMapAbstract = new System.Windows.Forms.GroupBox(); + this.buttonClear = new System.Windows.Forms.Button(); + this.buttonLoad = new System.Windows.Forms.Button(); + this.buttonSave = new System.Windows.Forms.Button(); + this.labelDevice = new System.Windows.Forms.Label(); + this.labelRemote = new System.Windows.Forms.Label(); + this.comboBoxDevice = new System.Windows.Forms.ComboBox(); + this.textBoxRemoteName = new System.Windows.Forms.TextBox(); + this.listViewButtonMap = new System.Windows.Forms.ListView(); + this.columnHeaderAbstractButton = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderKeyCode = new System.Windows.Forms.ColumnHeader(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.groupBoxSetup.SuspendLayout(); + this.groupBoxStatus.SuspendLayout(); + this.groupBoxMapAbstract.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxSetup + // + this.groupBoxSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxSetup.Controls.Add(this.comboBoxComputer); + this.groupBoxSetup.Controls.Add(this.labelServerAddress); + this.groupBoxSetup.Controls.Add(this.buttonConnect); + this.groupBoxSetup.Controls.Add(this.buttonDisconnect); + this.groupBoxSetup.Location = new System.Drawing.Point(8, 8); + this.groupBoxSetup.Name = "groupBoxSetup"; + this.groupBoxSetup.Size = new System.Drawing.Size(440, 64); + this.groupBoxSetup.TabIndex = 4; + this.groupBoxSetup.TabStop = false; + this.groupBoxSetup.Text = "Setup"; + // + // comboBoxComputer + // + this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxComputer.FormattingEnabled = true; + this.comboBoxComputer.Location = new System.Drawing.Point(8, 32); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(240, 21); + this.comboBoxComputer.TabIndex = 1; + // + // labelServerAddress + // + this.labelServerAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelServerAddress.Location = new System.Drawing.Point(8, 16); + this.labelServerAddress.Name = "labelServerAddress"; + this.labelServerAddress.Size = new System.Drawing.Size(240, 16); + this.labelServerAddress.TabIndex = 0; + this.labelServerAddress.Text = "IR Server host computer:"; + // + // buttonConnect + // + this.buttonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonConnect.Location = new System.Drawing.Point(264, 32); + this.buttonConnect.Name = "buttonConnect"; + this.buttonConnect.Size = new System.Drawing.Size(80, 24); + this.buttonConnect.TabIndex = 2; + this.buttonConnect.Text = "Connect"; + this.buttonConnect.UseVisualStyleBackColor = true; + this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click); + // + // buttonDisconnect + // + this.buttonDisconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDisconnect.Location = new System.Drawing.Point(352, 32); + this.buttonDisconnect.Name = "buttonDisconnect"; + this.buttonDisconnect.Size = new System.Drawing.Size(80, 24); + this.buttonDisconnect.TabIndex = 3; + this.buttonDisconnect.Text = "Disconnect"; + this.buttonDisconnect.UseVisualStyleBackColor = true; + this.buttonDisconnect.Click += new System.EventHandler(this.buttonDisconnect_Click); + // + // groupBoxStatus + // + this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxStatus.Controls.Add(this.listBoxStatus); + this.groupBoxStatus.Location = new System.Drawing.Point(8, 344); + this.groupBoxStatus.Name = "groupBoxStatus"; + this.groupBoxStatus.Size = new System.Drawing.Size(440, 216); + this.groupBoxStatus.TabIndex = 5; + this.groupBoxStatus.TabStop = false; + this.groupBoxStatus.Text = "Status"; + // + // listBoxStatus + // + this.listBoxStatus.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.listBoxStatus.FormattingEnabled = true; + this.listBoxStatus.HorizontalScrollbar = true; + this.listBoxStatus.IntegralHeight = false; + this.listBoxStatus.Location = new System.Drawing.Point(8, 16); + this.listBoxStatus.Name = "listBoxStatus"; + this.listBoxStatus.ScrollAlwaysVisible = true; + this.listBoxStatus.Size = new System.Drawing.Size(424, 185); + this.listBoxStatus.TabIndex = 0; + // + // groupBoxMapAbstract + // + this.groupBoxMapAbstract.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.groupBoxMapAbstract.Controls.Add(this.checkBox1); + this.groupBoxMapAbstract.Controls.Add(this.buttonClear); + this.groupBoxMapAbstract.Controls.Add(this.buttonLoad); + this.groupBoxMapAbstract.Controls.Add(this.buttonSave); + this.groupBoxMapAbstract.Controls.Add(this.labelDevice); + this.groupBoxMapAbstract.Controls.Add(this.labelRemote); + this.groupBoxMapAbstract.Controls.Add(this.comboBoxDevice); + this.groupBoxMapAbstract.Controls.Add(this.textBoxRemoteName); + this.groupBoxMapAbstract.Controls.Add(this.listViewButtonMap); + this.groupBoxMapAbstract.Location = new System.Drawing.Point(8, 80); + this.groupBoxMapAbstract.Name = "groupBoxMapAbstract"; + this.groupBoxMapAbstract.Size = new System.Drawing.Size(440, 256); + this.groupBoxMapAbstract.TabIndex = 6; + this.groupBoxMapAbstract.TabStop = false; + this.groupBoxMapAbstract.Text = "Abstract Remote Map"; + // + // buttonClear + // + this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonClear.Location = new System.Drawing.Point(8, 224); + this.buttonClear.Name = "buttonClear"; + this.buttonClear.Size = new System.Drawing.Size(80, 24); + this.buttonClear.TabIndex = 7; + this.buttonClear.Text = "Clear"; + this.buttonClear.UseVisualStyleBackColor = true; + this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click); + // + // buttonLoad + // + this.buttonLoad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLoad.Location = new System.Drawing.Point(264, 224); + this.buttonLoad.Name = "buttonLoad"; + this.buttonLoad.Size = new System.Drawing.Size(80, 24); + this.buttonLoad.TabIndex = 5; + this.buttonLoad.Text = "Load"; + this.buttonLoad.UseVisualStyleBackColor = true; + this.buttonLoad.Click += new System.EventHandler(this.buttonLoad_Click); + // + // buttonSave + // + this.buttonSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSave.Location = new System.Drawing.Point(352, 224); + this.buttonSave.Name = "buttonSave"; + this.buttonSave.Size = new System.Drawing.Size(80, 24); + this.buttonSave.TabIndex = 6; + this.buttonSave.Text = "Save"; + this.buttonSave.UseVisualStyleBackColor = true; + this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click); + // + // labelDevice + // + this.labelDevice.Location = new System.Drawing.Point(232, 24); + this.labelDevice.Name = "labelDevice"; + this.labelDevice.Size = new System.Drawing.Size(72, 20); + this.labelDevice.TabIndex = 4; + this.labelDevice.Text = "Receiver:"; + // + // labelRemote + // + this.labelRemote.Location = new System.Drawing.Point(8, 24); + this.labelRemote.Name = "labelRemote"; + this.labelRemote.Size = new System.Drawing.Size(96, 20); + this.labelRemote.TabIndex = 3; + this.labelRemote.Text = "Remote name:"; + // + // comboBoxDevice + // + this.comboBoxDevice.FormattingEnabled = true; + this.comboBoxDevice.Location = new System.Drawing.Point(304, 24); + this.comboBoxDevice.Name = "comboBoxDevice"; + this.comboBoxDevice.Size = new System.Drawing.Size(128, 21); + this.comboBoxDevice.TabIndex = 2; + // + // textBoxRemoteName + // + this.textBoxRemoteName.Location = new System.Drawing.Point(104, 24); + this.textBoxRemoteName.Name = "textBoxRemoteName"; + this.textBoxRemoteName.Size = new System.Drawing.Size(104, 20); + this.textBoxRemoteName.TabIndex = 1; + // + // listViewButtonMap + // + this.listViewButtonMap.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.listViewButtonMap.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderAbstractButton, + this.columnHeaderKeyCode}); + this.listViewButtonMap.FullRowSelect = true; + this.listViewButtonMap.GridLines = true; + this.listViewButtonMap.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewButtonMap.HideSelection = false; + this.listViewButtonMap.Location = new System.Drawing.Point(8, 48); + this.listViewButtonMap.MultiSelect = false; + this.listViewButtonMap.Name = "listViewButtonMap"; + this.listViewButtonMap.Size = new System.Drawing.Size(424, 168); + this.listViewButtonMap.TabIndex = 0; + this.listViewButtonMap.UseCompatibleStateImageBehavior = false; + this.listViewButtonMap.View = System.Windows.Forms.View.Details; + this.listViewButtonMap.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listViewButtonMap_KeyDown); + // + // columnHeaderAbstractButton + // + this.columnHeaderAbstractButton.Text = "AbstractButton"; + this.columnHeaderAbstractButton.Width = 116; + // + // columnHeaderKeyCode + // + this.columnHeaderKeyCode.Text = "KeyCode"; + this.columnHeaderKeyCode.Width = 288; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(136, 224); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(85, 17); + this.checkBox1.TabIndex = 8; + this.checkBox1.Text = "Toggle Keys"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(456, 569); + this.Controls.Add(this.groupBoxMapAbstract); + this.Controls.Add(this.groupBoxSetup); + this.Controls.Add(this.groupBoxStatus); + this.Name = "MainForm"; + this.Text = "Abstractor"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.groupBoxSetup.ResumeLayout(false); + this.groupBoxStatus.ResumeLayout(false); + this.groupBoxMapAbstract.ResumeLayout(false); + this.groupBoxMapAbstract.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxSetup; + private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.Label labelServerAddress; + private System.Windows.Forms.Button buttonConnect; + private System.Windows.Forms.Button buttonDisconnect; + private System.Windows.Forms.GroupBox groupBoxStatus; + private System.Windows.Forms.ListBox listBoxStatus; + private System.Windows.Forms.GroupBox groupBoxMapAbstract; + private System.Windows.Forms.Button buttonClear; + private System.Windows.Forms.Button buttonLoad; + private System.Windows.Forms.Button buttonSave; + private System.Windows.Forms.Label labelDevice; + private System.Windows.Forms.Label labelRemote; + private System.Windows.Forms.ComboBox comboBoxDevice; + private System.Windows.Forms.TextBox textBoxRemoteName; + private System.Windows.Forms.ListView listViewButtonMap; + private System.Windows.Forms.ColumnHeader columnHeaderAbstractButton; + private System.Windows.Forms.ColumnHeader columnHeaderKeyCode; + private System.Windows.Forms.CheckBox checkBox1; + } +} + Added: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,612 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +using IrssComms; +using IrssUtils; + +namespace Abstractor +{ + + public partial class MainForm : Form + { + + public enum AbstractButton + { + Up, + Down, + Left, + Right, + OK, + VolumeUp, + VolumeDown, + ChannelUp, + ChannelDown, + Start, + Back, + Info, + Mute, + Number0, + Number1, + Number2, + Number3, + Number4, + Number5, + Number6, + Number7, + Number8, + Number9, + Play, + Pause, + PlayPause, + Stop, + FastForward, + Rewind, + Record, + NextChapter, + PreviousChapter, + Power, + Power2, + Power3, + Teletext, + TeletextRed, + TeletextGreen, + TeletextYellow, + TeletextBlue, + Subtitles, + Menu, + Clear, + Enter, + Hash, + Star, + TaskSwap, + Fullscreen, + AspectRatio, + Setup, + Music, + Pictures, + Videos, + DVD, + TV, + Guide, + LiveTV, + Snapshot, + Open, + Close, + Eject, + ScrollUp, + ScrollDown, + PageUp, + PageDown, + } + + + #region Variables + + Client _client; + + string _serverHost = "localhost"; + + bool _registered; + + IRServerInfo _irServerInfo = new IRServerInfo(); + + DataSet _abstractRemoteButtons; + + #endregion Variables + + delegate void DelegateAddStatusLine(string status); + DelegateAddStatusLine _addStatusLine; + + void AddStatusLine(string status) + { + IrssLog.Info(status); + + listBoxStatus.Items.Add(status); + + listBoxStatus.SetSelected(listBoxStatus.Items.Count - 1, true); + } + + + delegate void DelegateSetDevices(string[] devices); + DelegateSetDevices _setDevices; + + void SetDevices(string[] devices) + { + comboBoxDevice.Items.Clear(); + comboBoxDevice.Items.AddRange(devices); + comboBoxDevice.SelectedIndex = 0; + + if (String.IsNullOrEmpty(textBoxRemoteName.Text)) + textBoxRemoteName.Text = devices[0]; + } + + + public MainForm() + { + IrssLog.LogLevel = IrssLog.Level.Debug; + IrssLog.Open(Common.FolderIrssLogs + "Abstractor.log"); + + InitializeComponent(); + + _addStatusLine = new DelegateAddStatusLine(AddStatusLine); + _setDevices = new DelegateSetDevices(SetDevices); + + comboBoxComputer.Items.Clear(); + comboBoxComputer.Items.Add("localhost"); + + List<string> networkPCs = Network.GetComputers(false); + if (networkPCs != null) + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + + comboBoxComputer.Text = _serverHost; + + ClearMap(); + /* + + DataTable table = new DataTable("RemoteTable"); + + DataColumn column; + + column = new DataColumn("RawCode", typeof(string)); + column.Caption = "Raw Code"; + column.ColumnMapping = MappingType.Attribute; + column.DefaultValue = String.Empty; + column.ReadOnly = false; + column.Unique = true; + table.Columns.Add(column); + + column = new DataColumn("AbstractButton", typeof(string)); + column.Caption = "Abstract Button"; + column.ColumnMapping = MappingType.Attribute; + column.DefaultValue = String.Empty; + column.ReadOnly = false; + column.Unique = false; + table.Columns.Add(column); + + string[] names = Enum.GetNames(typeof(MceButton)); + foreach (string name in names) + { + int button = (int)Enum.Parse(typeof(MceButton), name); + + table.Rows.Add(button.ToString(), name); + } + + //table.WriteXmlSchema("RemoteTable.xsd"); + + table.WriteXml("Microsoft MCE.xml"); + table.WriteXml("XBCDRC.xml"); + + */ + + //_abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); + //_abstractRemoteButtons.CaseSensitive = true; + + //_abstractRemoteButtons.ReadXmlSchema("RemoteTable.xsd"); + + + //_abstractRemoteButtons.Tables.Add(table); + //_abstractRemoteButtons.Tables.Add(table); + + + //_lookupTable.WriteXmlSchema("Abstract Remote Model 0.1.xsd"); + //_lookupTable.WriteXml("Abstract Remote Button List.xml", XmlWriteMode.WriteSchema); + //_abstractRemoteButtons.WriteXml("Abstract Remote Button List.xml", XmlWriteMode.WriteSchema); + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + buttonDisconnect_Click(null, null); + + _addStatusLine = null; + _setDevices = null; + + IrssLog.Close(); + } + + + void ReceivedMessage(IrssMessage received) + { + this.Invoke(_addStatusLine, new Object[] { String.Format("Received Message: \"{0}, {1}\"", received.Type, received.Flags) }); + + try + { + switch (received.Type) + { + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + _registered = true; + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); + + _client.Send(new IrssMessage(MessageType.ActiveReceivers, MessageFlags.Request)); + _client.Send(new IrssMessage(MessageType.ActiveBlasters, MessageFlags.Request)); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + _registered = false; + } + return; + + case MessageType.ActiveBlasters: + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); + break; + + case MessageType.ActiveReceivers: + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); + + string[] receivers = received.GetDataAsString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + + this.Invoke(_setDevices, new Object[] { receivers }); + + LoadDeviceFiles(receivers); + break; + + case MessageType.RemoteEvent: + byte[] data = received.GetDataAsBytes(); + int deviceNameSize = BitConverter.ToInt32(data, 0); + string deviceName = Encoding.ASCII.GetString(data, 4, deviceNameSize); + int keyCodeSize = BitConverter.ToInt32(data, 4 + deviceNameSize); + string keyCode = Encoding.ASCII.GetString(data, 8 + deviceNameSize, keyCodeSize); + + RemoteHandlerCallback(deviceName, keyCode); + return; + + case MessageType.ServerShutdown: + _registered = false; + return; + + case MessageType.Error: + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); + return; + } + } + catch (Exception ex) + { + this.Invoke(_addStatusLine, new Object[] { ex.Message }); + } + } + + void RemoteHandlerCallback(string deviceName, string keyCode) + { + string text = String.Format("Remote Event \"{0}\", \"{1}\"", deviceName, keyCode); + this.Invoke(_addStatusLine, text); + + // If this remote event matches the criteria then set it to an abstract button in the list view ... + if (deviceName.Equals(comboBoxDevice.Text, StringComparison.OrdinalIgnoreCase)) + { + if (listViewButtonMap.SelectedItems.Count == 1) + { + bool found = false; + foreach (ListViewItem item in listViewButtonMap.Items) + if (item.SubItems[1].Text.Equals(keyCode, StringComparison.OrdinalIgnoreCase)) + found = true; + + if (!found) + { + int index = listViewButtonMap.SelectedIndices[0]; + listViewButtonMap.SelectedItems[0].SubItems[1].Text = keyCode; + listViewButtonMap.SelectedIndices.Clear(); + + if (listViewButtonMap.Items.Count > index + 1) + { + listViewButtonMap.SelectedIndices.Add(index + 1); + listViewButtonMap.SelectedItems[0].Focused = true; + listViewButtonMap.EnsureVisible(index + 1); + } + } + } + } + + // Determine abstract button details ... + string abstractButton = LookupAbstractButton(deviceName, keyCode); + string abstractText = String.Format("Abstract Button \"{0}\"", abstractButton); + this.Invoke(_addStatusLine, abstractText); + } + + void CommsFailure(object obj) + { + Exception ex = obj as Exception; + + if (ex != null) + this.Invoke(_addStatusLine, new Object[] { String.Format("Communications failure: {0}", ex.Message) }); + else + this.Invoke(_addStatusLine, new Object[] { "Communications failure" }); + + StopClient(); + } + void Connected(object obj) + { + IrssLog.Info("Connected to server"); + + IrssMessage message = new IrssMessage(MessageType.RegisterClient, MessageFlags.Request); + _client.Send(message); + } + void Disconnected(object obj) + { + IrssLog.Warn("Communications with server has been lost"); + + Thread.Sleep(1000); + } + + bool StartClient(IPEndPoint endPoint) + { + if (_client != null) + return false; + + ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); + + _client = new Client(endPoint, sink); + _client.CommsFailureCallback = new WaitCallback(CommsFailure); + _client.ConnectCallback = new WaitCallback(Connected); + _client.DisconnectCallback = new WaitCallback(Disconnected); + + if (_client.Start()) + { + return true; + } + else + { + _client = null; + return false; + } + } + void StopClient() + { + if (_client == null) + return; + + _client.Dispose(); + _client = null; + } + + private void buttonConnect_Click(object sender, EventArgs e) + { + _abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); + _abstractRemoteButtons.CaseSensitive = true; + + try + { + AddStatusLine("Connect"); + listBoxStatus.Update(); + + if (_client != null) + { + AddStatusLine("Already connected/connecting"); + return; + } + + _serverHost = comboBoxComputer.Text; + + IPAddress serverIP = Client.GetIPFromName(_serverHost); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + } + catch (Exception ex) + { + AddStatusLine(ex.Message); + } + } + private void buttonDisconnect_Click(object sender, EventArgs e) + { + _abstractRemoteButtons = null; + + AddStatusLine("Disconnect"); + + try + { + if (_client == null) + { + AddStatusLine(" - Not connected"); + return; + } + + if (_registered) + { + IrssMessage message = new IrssMessage(MessageType.UnregisterClient, MessageFlags.Request); + _client.Send(message); + } + + StopClient(); + } + catch (Exception ex) + { + AddStatusLine(ex.Message); + } + } + + string LookupAbstractButton(string deviceName, string keyCode) + { + foreach (DataTable table in _abstractRemoteButtons.Tables) + { + string device = table.ExtendedProperties["Device"] as string; + + if (device.Equals(deviceName, StringComparison.OrdinalIgnoreCase)) + { + string expression = String.Format("RawCode = '{0}'", keyCode); + + DataRow[] rows = table.Select(expression); + if (rows.Length == 1) + { + string button = rows[0]["AbstractButton"].ToString() as string; + if (!String.IsNullOrEmpty(button)) + return button + " on " + table.ExtendedProperties["Remote"] as string + " through " + deviceName; + } + } + } + + return String.Format("{0} ({1})", deviceName, keyCode); + } + + + void LoadDeviceFiles(string[] devices) + { + foreach (string device in devices) + { + string[] files = Directory.GetFiles(device, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in files) + { + string remote = Path.GetFileNameWithoutExtension(file); + this.Invoke(_addStatusLine, String.Format("Loading {0} remote map \"{1}\"", device, remote)); + + DataTable table = _abstractRemoteButtons.Tables.Add("RemoteTable"); + table.ReadXmlSchema("RemoteTable.xsd"); + table.ReadXml(file); + + + table.ExtendedProperties.Add("Device", device); + table.ExtendedProperties.Add("Remote", remote); + + table.TableName = String.Format("{0}:{1}", device, remote); + } + } + } + + private void buttonClear_Click(object sender, EventArgs e) + { + ClearMap(); + } + private void buttonLoad_Click(object sender, EventArgs e) + { + LoadMap(); + } + private void buttonSave_Click(object sender, EventArgs e) + { + SaveMap(); + } + + + void ClearMap() + { + string[] abstractButtons = Enum.GetNames(typeof(AbstractButton)); + + listViewButtonMap.Items.Clear(); + foreach (string abstractButton in abstractButtons) + listViewButtonMap.Items.Add(new ListViewItem(new string[] { abstractButton, String.Empty })); + + listViewButtonMap.Sort(); + } + + + void SaveMap() + { + if (String.IsNullOrEmpty(textBoxRemoteName.Text)) + { + MessageBox.Show(this, "You must include a remote name before saving", "Missing remote name", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + string device = comboBoxDevice.Text; + + string fileName = Path.ChangeExtension(textBoxRemoteName.Text, ".xml"); + + string path = Path.Combine(device, fileName); + + this.Invoke(_addStatusLine, String.Format("Writing to file \"{0}\"", path)); + + DataTable table = new DataTable("RemoteTable"); + table.ReadXmlSchema("RemoteTable.xsd"); + + /* + DataColumn column; + + column = new DataColumn("RawCode", typeof(string)); + column.Caption = "Raw Code"; + column.ColumnMapping = MappingType.Attribute; + column.DefaultValue = String.Empty; + column.ReadOnly = false; + column.Unique = true; + table.Columns.Add(column); + + column = new DataColumn("AbstractButton", typeof(string)); + column.Caption = "Abstract Button"; + column.ColumnMapping = MappingType.Attribute; + column.DefaultValue = String.Empty; + column.ReadOnly = false; + column.Unique = false; + table.Columns.Add(column); + */ + + foreach (ListViewItem item in listViewButtonMap.Items) + { + if (!String.IsNullOrEmpty(item.SubItems[1].Text)) + table.Rows.Add(item.SubItems[1].Text, item.SubItems[0].Text); + } + + table.WriteXml(path); + } + + void LoadMap() + { + if (String.IsNullOrEmpty(textBoxRemoteName.Text)) + { + MessageBox.Show(this, "You must include a remote name before saving", "Missing remote name", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + string device = comboBoxDevice.Text; + + string fileName = Path.ChangeExtension(textBoxRemoteName.Text, ".xml"); + + string path = Path.Combine(device, fileName); + + if (!File.Exists(path)) + { + MessageBox.Show(this, String.Format("Remote file not found ({0}) in device folder ({1})", fileName, device), "Remote file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + this.Invoke(_addStatusLine, String.Format("Reading from file \"{0}\"", path)); + + DataTable table = new DataTable("RemoteTable"); + table.ReadXmlSchema("RemoteTable.xsd"); + + table.ReadXml(path); + + string[] abstractButtons = Enum.GetNames(typeof(AbstractButton)); + + listViewButtonMap.Items.Clear(); + foreach (string abstractButton in abstractButtons) + { + string[] subitems = new string[] { abstractButton, String.Empty }; + + DataRow[] rows = table.Select(String.Format("AbstractButton = '{0}'", abstractButton)); + + if (rows.Length == 1) + subitems[1] = rows[0]["RawCode"].ToString(); + + ListViewItem item = new ListViewItem(subitems); + listViewButtonMap.Items.Add(item); + } + + listViewButtonMap.Sort(); + } + + private void listViewButtonMap_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Space) + { + if (listViewButtonMap.SelectedItems.Count == 1) + { + listViewButtonMap.SelectedItems[0].SubItems[1].Text = String.Empty; + } + } + } + + + } + +} Added: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.resx 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,120 @@ +<?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> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace Abstractor +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Abstractor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Abstractor")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4d23d334-3b85-4d33-85a2-0071812ce053")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] Added: trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs 2008-02-28 06:41:36 UTC (rev 1402) @@ -0,0 +1,528 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +#pragma warning disable 1591 + +namespace Abstractor { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + [Serializable()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.ComponentModel.ToolboxItem(true)] + [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] + [System.Xml.Serialization.XmlRootAttribute("AbstractRemoteButtons")] + [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] + public partial class AbstractRemoteButtons : System.Data.DataSet { + + private RemoteTableDataTable tableRemoteTable; + + private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public AbstractRemoteButtons() { + this.BeginInit(); + this.InitClass(); + System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + base.Relations.CollectionChanged += schemaChangedHandler; + this.EndInit(); + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected AbstractRemoteButtons(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : + base(info, context, false) { + if ((this.IsBinarySerialized(info, context) == true)) { + this.InitVars(false); + System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + this.Tables.CollectionChanged += schemaChangedHandler1; + this.Relations.CollectionChanged += schemaChangedHandler1; + return; + } + string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); + if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) { + System.Data.DataSet ds = new System.Data.DataSet(); + ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema))); + if ((ds.Tables["RemoteTable"] != null)) { + base.Tables.Add(new RemoteTableDataTable(ds.Tables["RemoteTable"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema))); + } + this.GetSerializationData(info, context); + System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); + base.Tables.CollectionChanged += schemaChangedHandler; + this.Relations.CollectionChanged += schemaChangedHandler; + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.Browsable(false)] + [System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)] + public RemoteTableDataTable RemoteTable { + get { + return this.tableRemoteTable; + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.BrowsableAttribute(true)] + [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)] + public override System.Data.SchemaSerializationMode SchemaSerializationMode { + get { + return this._schemaSerializationMode; + } + set { + this._schemaSerializationMode = value; + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new System.Data.DataTableCollection Tables { + get { + return base.Tables; + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] + public new System.Data.DataRelationCollection Relations { + get { + return base.Relations; + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void InitializeDerivedDataSet() { + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + public override System.Data.DataSet Clone() { + AbstractRemoteButtons cln = ((AbstractRemoteButtons)(base.Clone())); + cln.InitVars(); + cln.SchemaSerializationMode = this.SchemaSerializationMode; + return cln; + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override bool ShouldSerializeTables() { + return false; + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override bool ShouldSerializeRelations() { + return false; + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void ReadXmlSerializable(System.Xml.XmlReader reader) { + if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) { + this.Reset(); + System.Data.DataSet ds = new System.Data.DataSet(); + ds.ReadXml(reader); + if ((ds.Tables["RemoteTable"] != null)) { + base.Tables.Add(new RemoteTableDataTable(ds.Tables["RemoteTable"])); + } + this.DataSetName = ds.DataSetName; + this.Prefix = ds.Prefix; + this.Namespace = ds.Namespace; + this.Locale = ds.Locale; + this.CaseSensitive = ds.CaseSensitive; + this.EnforceConstraints = ds.EnforceConstraints; + this.Merge(ds, false, System.Data.MissingSchemaAction.Add); + this.InitVars(); + } + else { + this.ReadXml(reader); + this.InitVars(); + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() { + System.IO.MemoryStream stream = new System.IO.MemoryStream(); + this.WriteXmlSchema(new System.Xml.XmlTextWriter(stream, null)); + stream.Position = 0; + return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(stream), null); + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal void InitVars() { + this.InitVars(true); + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal void InitVars(bool initTable) { + this.tableRemoteTable = ((RemoteTableDataTable)(base.Tables["RemoteTable"])); + if ((initTable == true)) { + if ((this.tableRemoteTable != null)) { + this.tableRemoteTable.InitVars(); + } + } + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + private void InitClass() { + this.DataSetName = "AbstractRemoteButtons"; + this.Prefix = ""; + this.Locale = new System.Globalization.CultureInfo("en"); + this.EnforceConstraints = true; + this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; + this.tableRemoteTable = new RemoteTableDataTable(); + base.Tables.Add(this.tableRemoteTable... [truncated message content] |
From: <an...@us...> - 2008-03-03 06:55:10
|
Revision: 1416 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1416&view=rev Author: and-81 Date: 2008-03-02 22:55:09 -0800 (Sun, 02 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi Added Paths: ----------- trunk/plugins/MceIrApi/ trunk/plugins/MceIrApi/Api.cs trunk/plugins/MceIrApi/MceIr.dll trunk/plugins/MceIrApi/MceIrApi.csproj trunk/plugins/MceIrApi/MceIrApi.sln trunk/plugins/MceIrApi/Properties/ trunk/plugins/MceIrApi/Properties/AssemblyInfo.cs trunk/plugins/MceIrApi/TestApp/ trunk/plugins/MceIrApi/TestApp/FormMain.Designer.cs trunk/plugins/MceIrApi/TestApp/FormMain.cs trunk/plugins/MceIrApi/TestApp/FormMain.resx trunk/plugins/MceIrApi/TestApp/Program.cs trunk/plugins/MceIrApi/TestApp/Properties/ trunk/plugins/MceIrApi/TestApp/Properties/AssemblyInfo.cs trunk/plugins/MceIrApi/TestApp/TestApp.csproj Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -58,8 +58,6 @@ { get { - DboxFunctions dboxfunc = new DboxFunctions(_url, _userName, _password, _boxtype); - //dboxfunc.ErrorLog("data.cs box = " + _boxtype); string command = ""; string temp = ""; string sreturn = ""; @@ -79,7 +77,6 @@ sreturn = sreturn.Replace(";", " "); sreturn = sreturn.Replace(" selected", ""); // removes enigma v1's selected tag in bouquets output - //dboxfunc.ErrorLog("returned bouquets: " + sreturn); // set the bouquet command for this boxtype command = "/cgi-bin/getServices?ref="; break; @@ -111,7 +108,6 @@ } command = "/web/fetchchannels?ServiceListBrowse="; - //dboxfunc.ErrorLog("returned bouquets: " + sreturn); break; default: @@ -149,18 +145,13 @@ else temp = s.Split(' ')[0]; //otherboxes splitchar is " " - //dboxfunc.ErrorLog("splitted string to temp: " + temp); - if (_boxtype == "Neutrino") _Command = command + temp + "&mode=TV"; //build neutrino command else _Command = command + temp; //build enigma command - - //dboxfunc.ErrorLog("sending command: " + _Command); - + sreturn = request.PostData(_Command); //request list of channels contained in bouquetID "temp" sreturn = sreturn.Replace(";selected", ""); - //dboxfunc.ErrorLog("sent command and returned: " + sreturn); if (_boxtype == "Enigma v2") { @@ -190,21 +181,17 @@ string[] OneBouquet = sreturn.Split('\n'); string bucket = ""; - ////dboxfunc.ErrorLog("starting onebouquet again"); + if (OneBouquet[0] != "") { - foreach (string bouquets in OneBouquet) { - - //dboxfunc.ErrorLog("on top of onebouquets foreach"); if (bouquets != "") { - //dboxfunc.ErrorLog("string is: " + bouquets); if ((bouquets.IndexOf(' ') > -1) || (bouquets.IndexOf(';') > -1)) { row = table.NewRow(); - //dboxfunc.ErrorLog("created new row"); + int start = 0; // modifying the enigma string so it's the same as neutrino // that way I don't need to rewrite this textfilter @@ -218,8 +205,6 @@ bucket = Convert.ToString(++loopcount) + " " + chan_id + " " + chan_name; } - //dboxfunc.ErrorLog("starting string functions"); - //dboxfunc.ErrorLog("split tmp_ref: " + s + " number of chars: " + s.Length); if (_boxtype == "Neutrino") bucket = bouquets; @@ -233,21 +218,16 @@ start = tmp_Ref.Length + 1; String tmp_Bouquet = s.Substring(start, s.Length - start); - //dboxfunc.ErrorLog("split tmp_bouq, bucket is: " + bucket); String tmp_Channel = bucket.Split(' ')[0]; - //dboxfunc.ErrorLog("split channel"); String tmp_ID = bucket.Split(' ')[1]; if (_boxtype == "Enigma v1") tmp_ID = tmp_ID.Replace("1:0:0:0:0:0:0:0:0:0:", _url + "/rootX"); //workaround for the inability to stream internal recordings from the enigma hdd - //dboxfunc.ErrorLog("split ID"); start = tmp_Channel.Length + tmp_ID.Length + 2; String tmp_Name = bucket.Substring(start, bucket.Length - start); - //dboxfunc.ErrorLog("split name"); tmp_Name = tmp_Name.Replace("\"", "'"); - //dboxfunc.ErrorLog("ended string functions"); row["BouqNo"] = tmp_Ref; row["BouqName"] = tmp_Bouquet; @@ -255,19 +235,13 @@ row["ID"] = tmp_ID; row["Name"] = @tmp_Name; - //dboxfunc.ErrorLog("ended row functions"); - //dboxfunc.ErrorLog("added: " + tmp_Ref + "channel: " + tmp_Channel + "id: " + tmp_ID + "name: " + tmp_Name); // test if enigma got a error on service list - //dboxfunc.ErrorLog("trying to add row" + tmp_Channel); table.Rows.Add(row); - //dboxfunc.ErrorLog("Added row" + tmp_Channel); if (tmp_ID == "E:" || tmp_Name == "<n/a>") { // kill the row or we get error - //dboxfunc.ErrorLog("trying to remove row" + tmp_Channel); table.Rows.Remove(row); - //dboxfunc.ErrorLog("removed row" + tmp_Channel); } } } @@ -283,7 +257,7 @@ { } - //dboxfunc.ErrorLog("returning bouquets dataset"); + return ds; } } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -57,39 +57,6 @@ #endregion Constructor - public string GetID() - { - //ErrorLog("entered getid with " +_Url + " "+_UserName+" "+_Password+" "+_Boxtype); - Request request = new Request(_url, _userName, _password); - XmlDocument doc = new XmlDocument(); - XmlNode elem = doc.DocumentElement; - - string s = ""; - //get actual channel (ID) - - switch (_boxType) - { - case "Enigma v1": - doc.LoadXml(request.PostData("/xml/streaminfo")); - elem = doc.SelectSingleNode("/streaminfo/service/reference"); - s = elem.InnerText; - break; - - case "Enigma v2": - doc.LoadXml(request.PostData("/web/subservices")); - elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); - s = elem.InnerText; - break; - - default: - s = request.PostData(_command + "zapto"); - s = s.Replace("\n", ""); - //ErrorLog("get channel "+s+" for "+_Boxtype); - break; - } - - return s; - } public string ZapTo(string ID) { Request request = new Request(_url, _userName, _password); @@ -161,27 +128,6 @@ } } - public string GetEpgXml(string ID) - { - Request request = new Request(_url, _userName, _password); - string s = ""; - // get epg from box (xml formatted) - switch (_boxType) - { - case "Enigma v1": - s = request.PostData("/xml/serviceepg?ref=" + ID); - break; - case "Enigma v2": - s = request.PostData("/web/epgservice?ref=" + ID); - break; - default: - s = request.PostData(_command + "epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 - break; - } - s = s.Replace("&", "&"); - return s; - - } public void ShowMessage(string message) { Request request = new Request(_url, _userName, _password); @@ -228,6 +174,64 @@ return s; } + // Unused ... + + public string GetEpgXml(string ID) + { + Request request = new Request(_url, _userName, _password); + string s = ""; + // get epg from box (xml formatted) + switch (_boxType) + { + case "Enigma v1": + s = request.PostData("/xml/serviceepg?ref=" + ID); + break; + case "Enigma v2": + s = request.PostData("/web/epgservice?ref=" + ID); + break; + default: + s = request.PostData(_command + "epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 + break; + } + + s = s.Replace("&", "&"); + + return s; + } + public string GetID() + { + //ErrorLog("entered getid with " +_Url + " "+_UserName+" "+_Password+" "+_Boxtype); + Request request = new Request(_url, _userName, _password); + XmlDocument doc = new XmlDocument(); + XmlNode elem = doc.DocumentElement; + + string s = ""; + //get actual channel (ID) + + switch (_boxType) + { + case "Enigma v1": + doc.LoadXml(request.PostData("/xml/streaminfo")); + elem = doc.SelectSingleNode("/streaminfo/service/reference"); + s = elem.InnerText; + break; + + case "Enigma v2": + doc.LoadXml(request.PostData("/web/subservices")); + elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); + s = elem.InnerText; + break; + + default: + s = request.PostData(_command + "zapto"); + s = s.Replace("\n", ""); + //ErrorLog("get channel "+s+" for "+_Boxtype); + break; + } + + return s; + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -80,8 +80,18 @@ { case "SETUP": SetupForm setup = new SetupForm(); + setup.Address = _address; + setup.UserName = _userName; + setup.Password = _password; + setup.BoxType = _boxType; + if (setup.ShowDialog() == DialogResult.OK) { + _address = setup.Address; + _userName = setup.UserName; + _password = setup.Password; + _boxType = setup.BoxType; + SaveSettings(); Info("Setup saved"); } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -39,6 +39,7 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; + private System.Windows.Forms.Button buttonDetectBoxType; } } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -39,14 +39,36 @@ #region Variables - string _url = ""; - string _userName = ""; - string _password = ""; - string _boxType = ""; - static DataTable _bouquets = null; + string _boxType = "unknown"; #endregion Variables + #region Properties + + public string BoxType + { + get { return _boxType; } + set { _boxType = value; } + } + + public string Address + { + get { return textBoxIpAddress.Text; } + set { textBoxIpAddress.Text = value; } + } + public string UserName + { + get { return textBoxUserName.Text; } + set { textBoxUserName.Text = value; } + } + public string Password + { + get { return textBoxPassword.Text; } + set { textBoxPassword.Text = value; } + } + + #endregion Properties + #region Constructor public SetupForm() @@ -69,6 +91,7 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.buttonDetectBoxType = new System.Windows.Forms.Button(); this.statusStrip.SuspendLayout(); this.SuspendLayout(); // @@ -140,7 +163,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(128, 88); + this.buttonOK.Location = new System.Drawing.Point(128, 120); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 7; @@ -152,7 +175,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(200, 88); + this.buttonCancel.Location = new System.Drawing.Point(200, 120); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 8; @@ -164,7 +187,7 @@ // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel}); - this.statusStrip.Location = new System.Drawing.Point(0, 123); + this.statusStrip.Location = new System.Drawing.Point(0, 153); this.statusStrip.Name = "statusStrip"; this.statusStrip.Size = new System.Drawing.Size(272, 22); this.statusStrip.TabIndex = 9; @@ -174,11 +197,23 @@ this.toolStripStatusLabel.Name = "toolStripStatusLabel"; this.toolStripStatusLabel.Size = new System.Drawing.Size(0, 17); // + // buttonDetectBoxType + // + this.buttonDetectBoxType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonDetectBoxType.Location = new System.Drawing.Point(8, 120); + this.buttonDetectBoxType.Name = "buttonDetectBoxType"; + this.buttonDetectBoxType.Size = new System.Drawing.Size(104, 24); + this.buttonDetectBoxType.TabIndex = 10; + this.buttonDetectBoxType.Text = "Redetect box"; + this.buttonDetectBoxType.UseVisualStyleBackColor = true; + this.buttonDetectBoxType.Click += new System.EventHandler(this.buttonDetectBoxType_Click); + // // SetupForm // this.AcceptButton = this.buttonOK; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(272, 145); + this.ClientSize = new System.Drawing.Size(272, 175); + this.Controls.Add(this.buttonDetectBoxType); this.Controls.Add(this.statusStrip); this.Controls.Add(this.buttonGetData); this.Controls.Add(this.buttonCancel); @@ -191,7 +226,7 @@ this.Controls.Add(this.labelPassword); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(278, 170); + this.MinimumSize = new System.Drawing.Size(278, 200); this.Name = "SetupForm"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -203,68 +238,66 @@ } + static string DetectBoxType(string url, string userName, string password) + { + Request request = new Request(url, userName, password); + + // Detect Neutrino + string str1 = request.PostData("/control/getmode").ToLower(); + if (str1.Contains("tv") || str1.Contains("radio") || str1.Contains("unknown")) + return "Neutrino"; + + // Detect enigma v1 + string str2 = request.PostData("/cgi-bin/status").ToLower(); + if (str2.Contains("enigma")) + return "Enigma v1"; + + // Detect enigma v2 + string str3 = request.PostData("/web/stream.m3u"); + if (str3.Contains("#EXTM3U")) + return "Enigma v2"; + + return "unknown"; + } + private void buttonGetData_Click(object sender, EventArgs e) { StatusMessage("Attempting to read channel list ..."); try { - _url = "http://" + textBoxIpAddress.Text; - _userName = textBoxUserName.Text; - _password = textBoxPassword.Text; + string url = "http://" + textBoxIpAddress.Text; + string userName = textBoxUserName.Text; + string password = textBoxPassword.Text; + // Detect box type ... + if (_boxType.Equals("unknown", StringComparison.OrdinalIgnoreCase)) + { + _boxType = DetectBoxType(url, userName, password); + } - //detect boxtype - - // test if the value is one of the valid boxtypes, if it's not run detection routine - if (_boxType != "Neutrino" && _boxType != "Enigma v1" && _boxType != "Enigma v2") + if (_boxType.Equals("unknown", StringComparison.OrdinalIgnoreCase)) { - Request request = new Request(_url, _userName, _password); - _boxType = "unknown"; - - string str1 = request.PostData("/control/getmode").ToLower(); // neutrino - if (str1.Contains("tv") || str1.Contains("radio") || str1.Contains("unknown")) - _boxType = "Neutrino"; - - if (_boxType != "Neutrino") - { - string str2 = request.PostData("/cgi-bin/status").ToLower(); // enigma v1 - if (str2.Contains("enigma")) - _boxType = "Enigma v1"; - } - - if ((_boxType != "Neutrino") && (_boxType != "Enigma v1")) - { - string str3 = request.PostData("/web/stream.m3u"); // enigma v2 - if (str3.Contains("#EXTM3U")) - _boxType = "Enigma v2"; - } - - StatusMessage("Detected: {0}", _boxType); + StatusMessage("ERROR - No STB or unknown type detected!"); } + else + { + StatusMessage("Detected box type: {0}", _boxType); - if (_boxType == "Neutrino" || _boxType == "Enigma v1" || _boxType == "Enigma v2") - { - //get bouquets - Data _DBox = new Data(_url, _userName, _password, _boxType); - DboxFunctions dboxfunc = new DboxFunctions(_url, _userName, _password, _boxType); + Data data = new Data(url, userName, password, _boxType); - _bouquets = _DBox.UserTVBouquets.Tables[0]; + DataTable bouquets = data.UserTVBouquets.Tables[0]; - if (_bouquets.Rows.Count != 0) - StatusMessage("{0} channels found", _bouquets.Rows.Count); + if (bouquets.Rows.Count != 0) + StatusMessage("{0} channels found", bouquets.Rows.Count); else StatusMessage("ERROR - No channels found!"); if (File.Exists(Program.DataFile)) File.Delete(Program.DataFile); - _bouquets.WriteXml(Program.DataFile, XmlWriteMode.WriteSchema); + bouquets.WriteXml(Program.DataFile, XmlWriteMode.WriteSchema); } - else - { - StatusMessage("ERROR - No STB detected!"); - } } catch { @@ -289,6 +322,15 @@ this.Close(); } + private void buttonDetectBoxType_Click(object sender, EventArgs e) + { + string url = "http://" + textBoxIpAddress.Text; + string userName = textBoxUserName.Text; + string password = textBoxPassword.Text; + + _boxType = DetectBoxType(url, userName, password); + } + } } Modified: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-03 06:55:09 UTC (rev 1416) @@ -513,17 +513,27 @@ File "Applications\Virtual Remote\bin\Debug\*.*" File "Applications\Web Remote\bin\Debug\WebRemote.exe" + ; Installing skins CreateDirectory "$DIR_INSTALL\Virtual Remote\Skins" SetOutPath "$DIR_INSTALL\Virtual Remote\Skins" SetOverwrite ifnewer File "Applications\Virtual Remote\Skins\*.*" + ; Installing Virtual Remote for Smart Devices + CreateDirectory "$DIR_INSTALL\Virtual Remote\Smart Devices" + SetOutPath "$DIR_INSTALL\Virtual Remote\Smart Devices" + SetOverwrite ifnewer + File "Applications\Virtual Remote (PocketPC2003) Installer\Debug\*.cab" + File "Applications\Virtual Remote (Smartphone2003) Installer\Debug\*.cab" + File "Applications\Virtual Remote (WinCE5) Installer\Debug\*.cab" + ; Create folders CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote" ; Create start menu shortcut CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" 0 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" "" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" "$DIR_INSTALL\Virtual Remote\Smart Devices" SectionEnd @@ -694,7 +704,7 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "Control your whole PC." !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "Simple tray application to launch an application of your choosing when a particular button is pressed." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote)." + !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote and Smart Device versions)." !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemoteSkinEditor} "Create or Modify skins for the Virtual Remote." !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRBlast} "Command line tools for blasting IR codes." !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRFileTool} "Tool for learning, modifying, testing, correcting and converting IR command files." Modified: trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-03-03 05:53:52 UTC (rev 1415) +++ trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-03-03 06:55:09 UTC (rev 1416) @@ -513,17 +513,27 @@ File "Applications\Virtual Remote\bin\Release\*.*" File "Applications\Web Remote\bin\Release\WebRemote.exe" + ; Installing skins CreateDirectory "$DIR_INSTALL\Virtual Remote\Skins" SetOutPath "$DIR_INSTALL\Virtual Remote\Skins" SetOverwrite ifnewer File "Applications\Virtual Remote\Skins\*.*" + ; Installing Virtual Remote for Smart Devices + CreateDirectory "$DIR_INSTALL\Virtual Remote\Smart Devices" + SetOutPath "$DIR_INSTALL\Virtual Remote\Smart Devices" + SetOverwrite ifnewer + File "Applications\Virtual Remote (PocketPC2003) Installer\Release\*.cab" + File "Applications\Virtual Remote (Smartphone2003) Installer\Release\*.cab" + File "Applications\Virtual Remote (WinCE5) Installer\Release\*.cab" + ; Create folders CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote" ; Create start menu shortcut CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" 0 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" "" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" "$DIR_INSTALL\Virtual Remote\Smart Devices" SectionEnd @@ -694,7 +704,7 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "Control your whole PC." !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "Simple tray application to launch an application of your choosing when a particular button is pressed." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote)." + !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote and Smart Device versions)." !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemoteSkinEditor} "Create or Modify skins for the Virtual Remote." !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRBlast} "Command line tools for blasting IR codes." !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRFileTool} "Tool for learning, modifying, testing, correcting and converting IR command files." Property changes on: trunk/plugins/MceIrApi ___________________________________________________________________ Name: svn:ignore + bin *.suo obj Added: trunk/plugins/MceIrApi/Api.cs =================================================================== --- trunk/plugins/MceIrApi/Api.cs (rev 0) +++ trunk/plugins/MceIrApi/Api.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,365 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; + +using Microsoft.Win32.SafeHandles; + +namespace MceIr +{ + + /// <summary> + /// Callback for remote button press events. + /// </summary> + public delegate void ButtonReceived(int buttonCode); + + /// <summary> + /// This wrapper class provides access to the MceIr.dll functions. + /// Expects MceIr.dll extended by Aaron Dinnage. + /// </summary> + public class Api : NativeWindow + { + + #region Interop + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrRegisterEvents(IntPtr windowHandle); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrUnregisterEvents(); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrSetRepeatTimes(int firstRepeat, int nextRepeats); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrRecordToFile(SafeFileHandle fileHandle, int timeout); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrPlaybackFromFile(SafeFileHandle fileHandle); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrSuspend(); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrResume(); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrSelectBlaster(int portNumber); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrCheckFile(SafeFileHandle fileHandle); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrSetBlasterSpeed(int speed); + + [DllImport("MceIr.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool MceIrSetBlasterType(int type); + + #endregion Interop + + #region Constants + + const int WM_USER = 0x0400; + const int ID_MCEIR_KEYCODE = 0x37FF0; + + #endregion + + #region Enumerations + + /// <summary> + /// The blaster port to send IR codes to. + /// </summary> + public enum BlasterPort + { + /// <summary> + /// Send IR codes to both blaster ports. + /// </summary> + Both = 0, + /// <summary> + /// Send IR codes to blaster port 1 only. + /// </summary> + Port_1 = 1, + /// <summary> + /// Send IR codes to blaster port 2 only. + /// </summary> + Port_2 = 2 + } + + /// <summary> + /// Type of blaster in use. + /// </summary> + public enum BlasterType + { + /// <summary> + /// Device is a first party Microsoft MCE transceiver. + /// </summary> + Microsoft = 0, + /// <summary> + /// Device is an third party SMK MCE transceiver. + /// </summary> + SMK = 1 + } + + /// <summary> + /// Speed to transmit IR codes at (this is a crude Carrier Frequency control). + /// </summary> + public enum BlasterSpeed + { + /// <summary> + /// None - Do not set the blaster speed. + /// (Note: If an IR code has been sent with a speed setting previously + /// then that speed setting will continue to take effect, until the + /// unit's power is cycled) + /// </summary> + None = 0, + /// <summary> + /// Fast - Set blaster speed to fast. + /// </summary> + Fast = 1, + /// <summary> + /// Medium - Set blaster speed to medium. + /// </summary> + Medium = 2, + /// <summary> + /// Slow - Set blaster speed to slow. + /// </summary> + Slow = 3, + } + + #endregion Enumerations + + #region Variables + + //ReceiverWindow _window; + + ButtonReceived _buttonReceived; + + bool _isSuspended = false; + bool _inUse = false; + + #endregion Variables + + #region Properties + + /// <summary> + /// Gets a value indicating whether the API is in use. + /// </summary> + /// <value><c>true</c> if in use; otherwise, <c>false</c>.</value> + public bool InUse + { + get { return _inUse; } + } + + #endregion Properties + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="Api"/> class. + /// </summary> + public Api() + { + CreateParams cp = new CreateParams(); + CreateHandle(cp); + } + + #endregion Constructor + + #region Public Methods + + /// <summary> + /// Start the API and begin receiving button presses. + /// </summary> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool Start(ButtonReceived buttonReceived) + { + _buttonReceived = buttonReceived; + + _inUse = true; + if (MceIrRegisterEvents(this.Handle)) + { + Resume(); + return true; + } + + return false; + } + + /// <summary> + /// Stop listening for button presses. + /// </summary> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool Stop() + { + if (MceIrUnregisterEvents()) + { + Suspend(); + _inUse = false; + return true; + } + + return false; + } + + /// <summary> + /// Suspend the MceIrApi. + /// Call this before entering a suspended power state. + /// </summary> + public void Suspend() + { + if (!_isSuspended) + { + _inUse = true; + _isSuspended = true; + MceIrSuspend(); + } + } + + /// <summary> + /// Resume the MceIrApi. + /// Call this after returning from a suspended power state. + /// </summary> + public void Resume() + { + if (_isSuspended) + { + _inUse = true; + _isSuspended = false; + MceIrResume(); + Thread.Sleep(250); + } + } + + /// <summary> + /// Set the Blaster port to use for transmitting IR Codes. + /// </summary> + /// <param name="port">Port to send to.</param> + public void SetBlasterPort(BlasterPort port) + { + _inUse = true; + MceIrSelectBlaster((int)port); + } + + /// <summary> + /// Set the Speed to transmit IR Codes at. + /// </summary> + /// <param name="speed">IR Code speed.</param> + public void SetBlasterSpeed(BlasterSpeed speed) + { + _inUse = true; + MceIrSetBlasterSpeed((int)speed); + } + + /// <summary> + /// Set the Type of MCE unit. + /// </summary> + /// <param name="type">Manufacturer of MCE unit.</param> + public void SetBlasterType(BlasterType type) + { + _inUse = true; + MceIrSetBlasterType((int)type); + } + + /// <summary> + /// Check an IR Code file to ensure it is valid. + /// </summary> + /// <param name="filePath">The file path.</param> + /// <returns><c>true</c> if the file is valid, otherwise <c>false</c>.</returns> + public bool CheckIRFile(string filePath) + { + bool result = false; + + using (FileStream file = File.OpenRead(filePath)) + { + _inUse = true; + result = MceIrCheckFile(file.SafeFileHandle); + } + + return result; + } + + /// <summary> + /// Sets the time between key presses being repeated. + /// All times are in milliseconds. + /// </summary> + /// <param name="firstRepeat">How long after the button is pressed before repeating.</param> + /// <param name="nextRepeats">How long between repeats.</param> + public void SetRepeatTimes(int firstRepeat, int nextRepeats) + { + _inUse = true; + MceIrSetRepeatTimes(firstRepeat, nextRepeats); + } + + /// <summary> + /// Record an IR code to file. + /// </summary> + /// <param name="filePath">File to write to.</param> + /// <param name="timeout">How long before a timeout occurs (in milliseconds).</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool RecordToFile(string filePath, int timeout) + { + bool result = false; + + using (FileStream file = File.Create(filePath)) + { + _inUse = true; + result = MceIrRecordToFile(file.SafeFileHandle, timeout); + } + + return result; + } + + /// <summary> + /// Transmit an IR Code from a file. + /// </summary> + /// <param name="filePath">The file path.</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool PlaybackFromFile(string filePath) + { + bool result = false; + + using (FileStream file = File.OpenRead(filePath)) + { + _inUse = true; + result = MceIrPlaybackFromFile(file.SafeFileHandle); + } + + Thread.Sleep(250); + return result; + } + + #endregion Public Methods + + /// <summary> + /// Invokes the default window procedure associated with this window. + /// </summary> + /// <param name="m">A <see cref="T:System.Windows.Forms.Message"></see> that is associated with the current Windows message.</param> + protected override void WndProc(ref Message m) + { + if (m.Msg == WM_USER) + { + if (m.WParam.ToInt32() == ID_MCEIR_KEYCODE) + { + if (_buttonReceived != null) + _buttonReceived(m.LParam.ToInt32() & 0xFFFF); + } + } + + base.WndProc(ref m); + } + + } + +} Added: trunk/plugins/MceIrApi/MceIr.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MceIrApi/MceIr.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MceIrApi/MceIrApi.csproj =================================================================== --- trunk/plugins/MceIrApi/MceIrApi.csproj (rev 0) +++ trunk/plugins/MceIrApi/MceIrApi.csproj 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,57 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MceIr</RootNamespace> + <AssemblyName>MceIrApi</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\MceIrApi.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Api.cs"> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="MceIr.dll"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/MceIrApi/MceIrApi.sln =================================================================== --- trunk/plugins/MceIrApi/MceIrApi.sln (rev 0) +++ trunk/plugins/MceIrApi/MceIrApi.sln 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MceIrApi", "MceIrApi.csproj", "{ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{0E8B7F94-8F69-491D-941B-ECE7EA119E47}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}.Release|Any CPU.Build.0 = Release|Any CPU + {0E8B7F94-8F69-491D-941B-ECE7EA119E47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E8B7F94-8F69-491D-941B-ECE7EA119E47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E8B7F94-8F69-491D-941B-ECE7EA119E47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E8B7F94-8F69-491D-941B-ECE7EA119E47}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MceIrApi/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MceIrApi/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MceIrApi/Properties/AssemblyInfo.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MceIrApi")] +[assembly: AssemblyDescription("Provides access to the MCE IR Device throught the MceIr.dll")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MceIrApi")] +[assembly: AssemblyCopyright("Copyright © Aaron Dinnage, 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0c7ff131-6ee5-4900-8a19-2bf59fcd1f55")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Property changes on: trunk/plugins/MceIrApi/TestApp ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/MceIrApi/TestApp/FormMain.Designer.cs =================================================================== --- trunk/plugins/MceIrApi/TestApp/FormMain.Designer.cs (rev 0) +++ trunk/plugins/MceIrApi/TestApp/FormMain.Designer.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,85 @@ +namespace TestApp +{ + partial class FormMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.listBox1 = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(8, 152); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Blast IR"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(200, 152); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Learn IR"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.Location = new System.Drawing.Point(8, 8); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(272, 134); + this.listBox1.TabIndex = 2; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 182); + this.Controls.Add(this.listBox1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "FormMain"; + this.Text = "FormMain"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ListBox listBox1; + } +} \ No newline at end of file Added: trunk/plugins/MceIrApi/TestApp/FormMain.cs =================================================================== --- trunk/plugins/MceIrApi/TestApp/FormMain.cs (rev 0) +++ trunk/plugins/MceIrApi/TestApp/FormMain.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace TestApp +{ + + public partial class FormMain : Form + { + + MceIr.Api api = new MceIr.Api(); + + public FormMain() + { + InitializeComponent(); + + api.Start(new MceIr.ButtonReceived(Received)); + } + + void Received(int button) + { + listBox1.Items.Add("Received: " + button); + } + + private void button1_Click(object sender, EventArgs e) + { + listBox1.Items.Add("Blasting IR ..."); + api.PlaybackFromFile("test.IR"); + } + + private void button2_Click(object sender, EventArgs e) + { + listBox1.Items.Add("Learning IR (5 second timeout) ..."); + api.RecordToFile("test.IR", 5000); + } + + private void FormMain_FormClosing(object sender, FormClosingEventArgs e) + { + api.Stop(); + } + + } + +} Added: trunk/plugins/MceIrApi/TestApp/FormMain.resx =================================================================== --- trunk/plugins/MceIrApi/TestApp/FormMain.resx (rev 0) +++ trunk/plugins/MceIrApi/TestApp/FormMain.resx 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,120 @@ +<?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> +</root> \ No newline at end of file Added: trunk/plugins/MceIrApi/TestApp/Program.cs =================================================================== --- trunk/plugins/MceIrApi/TestApp/Program.cs (rev 0) +++ trunk/plugins/MceIrApi/TestApp/Program.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +using Microsoft.Win32; + +namespace TestApp +{ + + class Program + { + + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.Run(new FormMain()); + } + + } + +} Added: trunk/plugins/MceIrApi/TestApp/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MceIrApi/TestApp/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MceIrApi/TestApp/Properties/AssemblyInfo.cs 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TestApp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TestApp")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("55cd2499-5cf4-44a0-b67a-2fc9cbd40d48")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/MceIrApi/TestApp/TestApp.csproj =================================================================== --- trunk/plugins/MceIrApi/TestApp/TestApp.csproj (rev 0) +++ trunk/plugins/MceIrApi/TestApp/TestApp.csproj 2008-03-03 06:55:09 UTC (rev 1416) @@ -0,0 +1,71 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{0E8B7F94-8F69-491D-941B-ECE7EA119E47}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TestApp</RootNamespace> + <AssemblyName>TestApp</AssemblyName> + <StartupObject>TestApp.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\MceIrApi.csproj"> + <Project>{ACEB9E54-94AD-4C6E-BED7-0E3969383CC1}</Project> + <Name>MceIrApi</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-04 00:52:53
|
Revision: 1420 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1420&view=rev Author: and-81 Date: 2008-03-03 16:52:52 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs trunk/plugins/ShortcutFileSupport/LnkPlayer.cs trunk/plugins/ShortcutFileSupport/ShortcutFileSupport Plugin.csproj Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -182,7 +182,7 @@ IrssLog.Info(message); Console.WriteLine(message); } - + static void LoadSettings() { try @@ -195,14 +195,17 @@ _password = doc.DocumentElement.Attributes["Password"].Value; _boxType = (StbBoxType)Enum.Parse(typeof(StbBoxType), doc.DocumentElement.Attributes["BoxType"].Value); } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + } catch (Exception ex) { IrssLog.Error(ex); - _address = "192.168.0.100"; - _userName = "root"; - _password = "dbox2"; - _boxType = StbBoxType.Unknown; + CreateDefaultSettings(); } } static void SaveSettings() @@ -231,7 +234,15 @@ IrssLog.Error(ex); } } + static void CreateDefaultSettings() + { + _address = "192.168.0.100"; + _userName = "root"; + _password = "dbox2"; + _boxType = StbBoxType.Unknown; + SaveSettings(); + } internal static string PostData(string url, string userName, string password, StbBoxType boxType, string command) { Modified: trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/Program.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/Program.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -62,6 +62,8 @@ Console.WriteLine("HCW PVR Tuner"); Console.WriteLine(); + // TODO: Add standard IRSS logging ... + if (args.Length != 1) { Console.WriteLine("Usage:"); 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-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -129,11 +129,17 @@ _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + } catch (Exception ex) { IrssLog.Error(ex); - _serverHost = "localhost"; + CreateDefaultSettings(); } } void SaveSettings() @@ -159,7 +165,14 @@ IrssLog.Error(ex); } } + void CreateDefaultSettings() + { + _serverHost = "localhost"; + SaveSettings(); + } + + delegate void UpdateWindowDel(string status); void UpdateWindow(string status) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -1555,7 +1555,7 @@ { string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; if (!String.IsNullOrEmpty(receivers)) - _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Program.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Program.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -253,12 +253,18 @@ { doc.Load(ConfigurationFile); } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + return; + } catch (Exception ex) { IrssLog.Error(ex); - _serverHost = "localhost"; - + CreateDefaultSettings(); return; } @@ -287,7 +293,13 @@ IrssLog.Error(ex); } } + static void CreateDefaultSettings() + { + _serverHost = "localhost"; + SaveSettings(); + } + static void CommsFailure(object obj) { Exception ex = obj as Exception; Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -193,14 +193,17 @@ _launchOnLoad = bool.Parse(doc.DocumentElement.Attributes["LaunchOnLoad"].Value); _launchKeyCode = doc.DocumentElement.Attributes["LaunchKeyCode"].Value; } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + } catch (Exception ex) { IrssLog.Error(ex); - _serverHost = "localhost"; - _programFile = String.Empty; - _launchOnLoad = false; - _launchKeyCode = DefaultKeyCode; + CreateDefaultSettings(); } } void SaveSettings() @@ -241,7 +244,16 @@ IrssLog.Error(ex); } } + void CreateDefaultSettings() + { + _serverHost = "localhost"; + _programFile = String.Empty; + _launchOnLoad = false; + _launchKeyCode = DefaultKeyCode; + SaveSettings(); + } + void CommsFailure(object obj) { Exception ex = obj as Exception; Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -242,13 +242,17 @@ { doc.Load(ConfigurationFile); } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + return; + } catch (Exception ex) { IrssLog.Error(ex); - - _serverHost = "localhost"; - _remoteSkin = DefaultSkin; - + CreateDefaultSettings(); return; } @@ -279,7 +283,15 @@ IrssLog.Error(ex); } } + static void CreateDefaultSettings() + { + _serverHost = "localhost"; + _remoteSkin = DefaultSkin; + SaveSettings(); + } + + static void CommsFailure(object obj) { Exception ex = obj as Exception; Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -489,11 +489,17 @@ _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + } catch (Exception ex) { IrssLog.Error(ex); - _serverHost = "localhost"; + CreateDefaultSettings(); } } void SaveSettings() @@ -519,7 +525,13 @@ IrssLog.Error(ex); } } + void CreateDefaultSettings() + { + _serverHost = "localhost"; + SaveSettings(); + } + void CommsFailure(object obj) { Exception ex = obj as Exception; Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -402,15 +402,18 @@ { doc.Load(ConfigurationFile); } + catch (FileNotFoundException) + { + IrssLog.Warn("Configuration file not found, using defaults"); + + CreateDefaultSettings(); + return; + } catch (Exception ex) { IrssLog.Error(ex); - _serverHost = "localhost"; - _remoteSkin = DefaultSkin; - _webPort = DefaultWebPort; - //_passwordHash = null; - + CreateDefaultSettings(); return; } @@ -445,7 +448,16 @@ IrssLog.Error(ex); } } + static void CreateDefaultSettings() + { + _serverHost = "localhost"; + _remoteSkin = DefaultSkin; + _webPort = DefaultWebPort; + //_passwordHash = null; + SaveSettings(); + } + static void CommsFailure(object obj) { Exception ex = obj as Exception; Modified: trunk/plugins/ShortcutFileSupport/LnkPlayer.cs =================================================================== --- trunk/plugins/ShortcutFileSupport/LnkPlayer.cs 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/ShortcutFileSupport/LnkPlayer.cs 2008-03-04 00:52:52 UTC (rev 1420) @@ -61,6 +61,10 @@ GUIGraphicsContext.ResetLastActivity(); GUIWindowManager.SendThreadMessage(message); + + message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO, 0, null); + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(message); } #endregion Implementation Modified: trunk/plugins/ShortcutFileSupport/ShortcutFileSupport Plugin.csproj =================================================================== --- trunk/plugins/ShortcutFileSupport/ShortcutFileSupport Plugin.csproj 2008-03-03 23:19:19 UTC (rev 1419) +++ trunk/plugins/ShortcutFileSupport/ShortcutFileSupport Plugin.csproj 2008-03-04 00:52:52 UTC (rev 1420) @@ -51,19 +51,18 @@ <Compile Include="ShellLink.cs" /> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.3.0\Core.DLL</HintPath> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Core.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> - <Reference Include="System.Data" /> <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"> + <Reference Include="Utils, Version=2.2.4.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.3.0\Utils.DLL</HintPath> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Utils.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-06 14:49:28
|
Revision: 1431 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1431&view=rev Author: and-81 Date: 2008-03-06 06:49:18 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/ShortcutFileSupport/LnkPlayer.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/IR507/ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/IR507/RC102.xml Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -45,6 +45,7 @@ static string _userName; static string _password; static StbBoxType _boxType; + static int _timeout; static string _url; static DataTable _tvBouquets; @@ -101,6 +102,7 @@ setup.UserName = _userName; setup.Password = _password; setup.BoxType = _boxType; + setup.Timeout = _timeout; if (setup.ShowDialog() == DialogResult.OK) { @@ -108,6 +110,7 @@ _userName = setup.UserName; _password = setup.Password; _boxType = setup.BoxType; + _timeout = setup.Timeout; SaveSettings(); Info("Setup saved"); @@ -204,6 +207,7 @@ _userName = doc.DocumentElement.Attributes["UserName"].Value; _password = doc.DocumentElement.Attributes["Password"].Value; _boxType = (StbBoxType)Enum.Parse(typeof(StbBoxType), doc.DocumentElement.Attributes["BoxType"].Value); + _timeout = int.Parse(doc.DocumentElement.Attributes["Timeout"].Value); } catch (FileNotFoundException) { @@ -234,6 +238,7 @@ writer.WriteAttributeString("UserName", _userName); writer.WriteAttributeString("Password", _password); writer.WriteAttributeString("BoxType", Enum.GetName(typeof(StbBoxType), _boxType)); + writer.WriteAttributeString("Timeout", _timeout.ToString()); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); @@ -246,22 +251,23 @@ } static void CreateDefaultSettings() { - _address = "192.168.0.100"; + _address = "192.168.0.100"; _userName = "root"; _password = "dbox2"; - _boxType = StbBoxType.Unknown; + _boxType = StbBoxType.Unknown; + _timeout = 2000; SaveSettings(); } - internal static string PostData(string url, string userName, string password, StbBoxType boxType, string command) + internal static string PostData(string url, string userName, string password, StbBoxType boxType, int timeout, string command) { try { Uri uri = new Uri(url + command); WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential(userName, password); - request.Timeout = 2000; + request.Timeout = timeout; // back to iso encoding sorry , should work anywhere in EU // which it doesn't, because dreambox use utf-8 encoding, making all UTF-8 extended characters a multibyte garble if we encode those to iso @@ -283,7 +289,7 @@ } } - internal static DataSet GetData(string url, string userName, string password, StbBoxType boxType) + internal static DataSet GetData(string url, string userName, string password, StbBoxType boxType, int timeout) { DataSet ds = new DataSet(); @@ -298,10 +304,10 @@ { case StbBoxType.EnigmaV1: // get userbouquets (ref=4097:7:0:6:0:0:0:0:0:0:) - sreturn = PostData(url, userName, password, boxType, "/cgi-bin/getServices?ref=4097:7:0:6:0:0:0:0:0:0:"); + sreturn = PostData(url, userName, password, boxType, timeout, "/cgi-bin/getServices?ref=4097:7:0:6:0:0:0:0:0:0:"); // get internal hdd recording - if (!PostData(url, userName, password, boxType, "/cgi-bin/getServices?ref=2:47:0:0:0:0:0:0:0:0:/var/media/movie/").Contains("E: ")) + if (!PostData(url, userName, password, boxType, timeout, "/cgi-bin/getServices?ref=2:47:0:0:0:0:0:0:0:0:/var/media/movie/").Contains("E: ")) sreturn += "2:47:0:0:0:0:0:0:0:0:/var/media/movie/;Recordings\n"; // replace neutrino split character with ; @@ -316,7 +322,7 @@ string serviceID = String.Empty; string serviceName = String.Empty; - string returnedXml = PostData(url, userName, password, boxType, "/web/fetchchannels?ServiceListBrowse=1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet"); + string returnedXml = PostData(url, userName, password, boxType, timeout, "/web/fetchchannels?ServiceListBrowse=1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet"); // xmlbased, return all userbouquets XmlDocument doc = new XmlDocument(); @@ -346,7 +352,7 @@ break; default: - sreturn = PostData(url, userName, password, boxType, "/control/getbouquets"); + sreturn = PostData(url, userName, password, boxType, timeout, "/control/getbouquets"); // set the bouquet command for this boxtype command = "/control/getbouquet?bouquet="; break; @@ -390,7 +396,7 @@ //request list of channels contained in bouquetID "temp" - sreturn = PostData(url, userName, password, boxType, curCommand); + sreturn = PostData(url, userName, password, boxType, timeout, curCommand); sreturn = sreturn.Replace(";selected", ""); if (boxType == StbBoxType.EnigmaV2) @@ -503,17 +509,17 @@ return ds; } - internal static StbBoxType DetectBoxType(string url, string userName, string password) + internal static StbBoxType DetectBoxType(string url, string userName, string password, int timeout) { - string str1 = PostData(url, userName, password, StbBoxType.Unknown, "/control/getmode").ToUpperInvariant(); + string str1 = PostData(url, userName, password, StbBoxType.Unknown, timeout, "/control/getmode").ToUpperInvariant(); if (str1.Contains("TV") || str1.Contains("RADIO") || str1.Contains("UNKNOWN")) return StbBoxType.Neutrino; - string str2 = PostData(url, userName, password, StbBoxType.Unknown, "/cgi-bin/status").ToUpperInvariant(); + string str2 = PostData(url, userName, password, StbBoxType.Unknown, timeout, "/cgi-bin/status").ToUpperInvariant(); if (str2.Contains("ENIGMA")) return StbBoxType.EnigmaV1; - string str3 = PostData(url, userName, password, StbBoxType.Unknown, "/web/stream.m3u").ToUpperInvariant(); + string str3 = PostData(url, userName, password, StbBoxType.Unknown, timeout, "/web/stream.m3u").ToUpperInvariant(); if (str3.Contains("#EXTM3U")) return StbBoxType.EnigmaV2; @@ -524,9 +530,9 @@ { switch (_boxType) { - case StbBoxType.EnigmaV1: return PostData(_url, _userName, _password, _boxType, "/cgi-bin/zapTo?path=" + ID); - case StbBoxType.EnigmaV2: return PostData(_url, _userName, _password, _boxType, "/web/zap?ZapTo=" + ID); - default: return PostData(_url, _userName, _password, _boxType, "/control/zapto?" + ID); + case StbBoxType.EnigmaV1: return PostData(_url, _userName, _password, _boxType, _timeout, "/cgi-bin/zapTo?path=" + ID); + case StbBoxType.EnigmaV2: return PostData(_url, _userName, _password, _boxType, _timeout, "/web/zap?ZapTo=" + ID); + default: return PostData(_url, _userName, _password, _boxType, _timeout, "/control/zapto?" + ID); } } static void WakeUp() @@ -534,15 +540,15 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - PostData(_url, _userName, _password, _boxType, "/cgi-bin/admin?command=wakeup"); + PostData(_url, _userName, _password, _boxType, _timeout, "/cgi-bin/admin?command=wakeup"); break; case StbBoxType.EnigmaV2: // donno if wakeup is correct command - PostData(_url, _userName, _password, _boxType, "/web/powerstate?newstate=wakeup"); + PostData(_url, _userName, _password, _boxType, _timeout, "/web/powerstate?newstate=wakeup"); break; case StbBoxType.Neutrino: // off = wakeup - PostData(_url, _userName, _password, _boxType, "/control/standby?off"); + PostData(_url, _userName, _password, _boxType, _timeout, "/control/standby?off"); break; } } @@ -551,7 +557,7 @@ //set playback to spts only required for neutrino, (i think) if (_boxType == StbBoxType.Neutrino) //send neutrino command - return PostData(_url, _userName, _password, _boxType, "/control/system?setAViAExtPlayBack=spts"); + return PostData(_url, _userName, _password, _boxType, _timeout, "/control/system?setAViAExtPlayBack=spts"); else // return ok for enigma return "ok"; } @@ -562,19 +568,19 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - status = PostData(_url, _userName, _password, _boxType, "/cgi-bin/audio?mute=0"); + status = PostData(_url, _userName, _password, _boxType, _timeout, "/cgi-bin/audio?mute=0"); break; case StbBoxType.EnigmaV2: - status = PostData(_url, _userName, _password, _boxType, "/web/vol?set=mute"); + status = PostData(_url, _userName, _password, _boxType, _timeout, "/web/vol?set=mute"); break; default: - status = PostData(_url, _userName, _password, _boxType, "/control/volume?status"); + status = PostData(_url, _userName, _password, _boxType, _timeout, "/control/volume?status"); if (status.Equals("0", StringComparison.Ordinal)) - status = PostData(_url, _userName, _password, _boxType, "/control/volume?mute"); + status = PostData(_url, _userName, _password, _boxType, _timeout, "/control/volume?mute"); if (status.Equals("1", StringComparison.Ordinal)) - status = PostData(_url, _userName, _password, _boxType, "/control/volume?unmute"); + status = PostData(_url, _userName, _password, _boxType, _timeout, "/control/volume?unmute"); break; } @@ -585,15 +591,15 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - PostData(_url, _userName, _password, _boxType, "/cgi-bin/xmessage?timeout=10&caption=Message&body=" + message); + PostData(_url, _userName, _password, _boxType, _timeout, "/cgi-bin/xmessage?timeout=10&caption=Message&body=" + message); break; case StbBoxType.EnigmaV2: - PostData(_url, _userName, _password, _boxType, "/web/message?type=1&timeout=10&text=" + message); + PostData(_url, _userName, _password, _boxType, _timeout, "/web/message?type=1&timeout=10&text=" + message); break; default: - PostData(_url, _userName, _password, _boxType, "/control/message?popup=" + message); + PostData(_url, _userName, _password, _boxType, _timeout, "/control/message?popup=" + message); break; } } @@ -604,18 +610,18 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - info = PostData(_url, _userName, _password, _boxType, "/xml/boxinfo"); + info = PostData(_url, _userName, _password, _boxType, _timeout, "/xml/boxinfo"); info = info.Replace("\n", " "); info = info.Replace(" ", ""); break; case StbBoxType.EnigmaV2: - info = PostData(_url, _userName, _password, _boxType, "/web/about"); + info = PostData(_url, _userName, _password, _boxType, _timeout, "/web/about"); info = info.Replace("\n", " "); break; default: - info = PostData(_url, _userName, _password, _boxType, "/control/info?version"); + info = PostData(_url, _userName, _password, _boxType, _timeout, "/control/info?version"); info = info.Replace("\n", " "); break; } @@ -632,15 +638,15 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - epgXml = PostData(_url, _userName, _password, _boxType, "/xml/serviceepg?ref=" + ID); + epgXml = PostData(_url, _userName, _password, _boxType, _timeout, "/xml/serviceepg?ref=" + ID); break; case StbBoxType.EnigmaV2: - epgXml = PostData(_url, _userName, _password, _boxType, "/web/epgservice?ref=" + ID); + epgXml = PostData(_url, _userName, _password, _boxType, _timeout, "/web/epgservice?ref=" + ID); break; default: - epgXml = PostData(_url, _userName, _password, _boxType, "/control/epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 + epgXml = PostData(_url, _userName, _password, _boxType, _timeout, "/control/epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 break; } @@ -659,21 +665,21 @@ switch (_boxType) { case StbBoxType.EnigmaV1: - xml = PostData(_url, _userName, _password, _boxType, "/xml/streaminfo"); + xml = PostData(_url, _userName, _password, _boxType, _timeout, "/xml/streaminfo"); doc.LoadXml(xml); elem = doc.SelectSingleNode("/streaminfo/service/reference"); id = elem.InnerText; break; case StbBoxType.EnigmaV2: - xml = PostData(_url, _userName, _password, _boxType, "/web/subservices"); + xml = PostData(_url, _userName, _password, _boxType, _timeout, "/web/subservices"); doc.LoadXml(xml); elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); id = elem.InnerText; break; default: - id = PostData(_url, _userName, _password, _boxType, "/control/zapto"); + id = PostData(_url, _userName, _password, _boxType, _timeout, "/control/zapto"); id = id.Replace("\n", ""); break; } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -40,6 +40,9 @@ private System.Windows.Forms.StatusStrip statusStrip; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; private System.Windows.Forms.Button buttonDetectBoxType; + private System.Windows.Forms.Label labelTimeout; + private System.Windows.Forms.NumericUpDown numericUpDownTimeout; + private System.Windows.Forms.Label labelMilliseconds; } } Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -43,6 +43,11 @@ get { return textBoxPassword.Text; } set { textBoxPassword.Text = value; } } + public int Timeout + { + get { return decimal.ToInt32(numericUpDownTimeout.Value); } + set { numericUpDownTimeout.Value = new decimal(value); } + } #endregion Properties @@ -69,13 +74,17 @@ this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.buttonDetectBoxType = new System.Windows.Forms.Button(); + this.labelTimeout = new System.Windows.Forms.Label(); + this.numericUpDownTimeout = new System.Windows.Forms.NumericUpDown(); + this.labelMilliseconds = new System.Windows.Forms.Label(); this.statusStrip.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); this.SuspendLayout(); // // buttonGetData // this.buttonGetData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonGetData.Location = new System.Drawing.Point(8, 88); + this.buttonGetData.Location = new System.Drawing.Point(8, 112); this.buttonGetData.Name = "buttonGetData"; this.buttonGetData.Size = new System.Drawing.Size(104, 24); this.buttonGetData.TabIndex = 6; @@ -140,7 +149,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(128, 120); + this.buttonOK.Location = new System.Drawing.Point(128, 144); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 7; @@ -152,7 +161,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(200, 120); + this.buttonCancel.Location = new System.Drawing.Point(200, 144); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 8; @@ -164,7 +173,7 @@ // this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel}); - this.statusStrip.Location = new System.Drawing.Point(0, 153); + this.statusStrip.Location = new System.Drawing.Point(0, 177); this.statusStrip.Name = "statusStrip"; this.statusStrip.Size = new System.Drawing.Size(272, 22); this.statusStrip.TabIndex = 9; @@ -177,7 +186,7 @@ // buttonDetectBoxType // this.buttonDetectBoxType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonDetectBoxType.Location = new System.Drawing.Point(8, 120); + this.buttonDetectBoxType.Location = new System.Drawing.Point(8, 144); this.buttonDetectBoxType.Name = "buttonDetectBoxType"; this.buttonDetectBoxType.Size = new System.Drawing.Size(104, 24); this.buttonDetectBoxType.TabIndex = 10; @@ -185,11 +194,61 @@ this.buttonDetectBoxType.UseVisualStyleBackColor = true; this.buttonDetectBoxType.Click += new System.EventHandler(this.buttonDetectBoxType_Click); // + // labelTimeout + // + this.labelTimeout.Location = new System.Drawing.Point(8, 80); + this.labelTimeout.Name = "labelTimeout"; + this.labelTimeout.Size = new System.Drawing.Size(80, 20); + this.labelTimeout.TabIndex = 11; + this.labelTimeout.Text = "Timeout:"; + this.labelTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownTimeout + // + this.numericUpDownTimeout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.numericUpDownTimeout.Increment = new decimal(new int[] { + 500, + 0, + 0, + 0}); + this.numericUpDownTimeout.Location = new System.Drawing.Point(88, 80); + this.numericUpDownTimeout.Maximum = new decimal(new int[] { + 60000, + 0, + 0, + 0}); + this.numericUpDownTimeout.Minimum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownTimeout.Name = "numericUpDownTimeout"; + this.numericUpDownTimeout.Size = new System.Drawing.Size(144, 20); + this.numericUpDownTimeout.TabIndex = 12; + this.numericUpDownTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTimeout.Value = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + // + // labelMilliseconds + // + this.labelMilliseconds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelMilliseconds.Location = new System.Drawing.Point(232, 80); + this.labelMilliseconds.Name = "labelMilliseconds"; + this.labelMilliseconds.Size = new System.Drawing.Size(32, 20); + this.labelMilliseconds.TabIndex = 13; + this.labelMilliseconds.Text = "ms"; + this.labelMilliseconds.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // SetupForm // - this.AcceptButton = this.buttonOK; - this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(272, 175); + this.ClientSize = new System.Drawing.Size(272, 199); + this.Controls.Add(this.labelMilliseconds); + this.Controls.Add(this.numericUpDownTimeout); + this.Controls.Add(this.labelTimeout); this.Controls.Add(this.buttonDetectBoxType); this.Controls.Add(this.statusStrip); this.Controls.Add(this.buttonGetData); @@ -210,6 +269,7 @@ this.Text = "Dbox Tuner Setup"; this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -225,7 +285,7 @@ // Detect box type ... if (BoxType == StbBoxType.Unknown) - BoxType = Program.DetectBoxType(url, UserName, Password); + BoxType = Program.DetectBoxType(url, UserName, Password, Timeout); if (BoxType == StbBoxType.Unknown) { @@ -235,7 +295,7 @@ { StatusMessage("Detected box type: {0}", _boxType); - DataSet dataSet = Program.GetData(url, UserName, Password, BoxType); + DataSet dataSet = Program.GetData(url, UserName, Password, BoxType, Timeout); DataTable dataTable = dataSet.Tables[0]; if (dataTable.Rows.Count != 0) @@ -283,7 +343,7 @@ private void buttonDetectBoxType_Click(object sender, EventArgs e) { - BoxType = Program.DetectBoxType(Program.UrlPrefix + Address, UserName, Password); + BoxType = Program.DetectBoxType(Program.UrlPrefix + Address, UserName, Password, Timeout); } } Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -39,9 +39,10 @@ this.listBoxStatus = new System.Windows.Forms.ListBox(); this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.groupBoxRemoteButton = new System.Windows.Forms.GroupBox(); - this.labelCustomButton = new System.Windows.Forms.Label(); - this.numericUpDownButton = new System.Windows.Forms.NumericUpDown(); - this.comboBoxRemoteButtons = new System.Windows.Forms.ComboBox(); + this.textBoxRemoteCode = new System.Windows.Forms.TextBox(); + this.textBoxRemoteDevice = new System.Windows.Forms.TextBox(); + this.labelRemoteCode = new System.Windows.Forms.Label(); + this.labelRemoteDevice = new System.Windows.Forms.Label(); this.buttonSendRemoteButton = new System.Windows.Forms.Button(); this.groupBoxSetup = new System.Windows.Forms.GroupBox(); this.comboBoxComputer = new System.Windows.Forms.ComboBox(); @@ -51,7 +52,6 @@ this.buttonHelp = new System.Windows.Forms.Button(); this.groupBoxStatus.SuspendLayout(); this.groupBoxRemoteButton.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).BeginInit(); this.groupBoxSetup.SuspendLayout(); this.groupBoxCommands.SuspendLayout(); this.SuspendLayout(); @@ -156,9 +156,10 @@ // this.groupBoxRemoteButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxRemoteButton.Controls.Add(this.labelCustomButton); - this.groupBoxRemoteButton.Controls.Add(this.numericUpDownButton); - this.groupBoxRemoteButton.Controls.Add(this.comboBoxRemoteButtons); + this.groupBoxRemoteButton.Controls.Add(this.textBoxRemoteCode); + this.groupBoxRemoteButton.Controls.Add(this.textBoxRemoteDevice); + this.groupBoxRemoteButton.Controls.Add(this.labelRemoteCode); + this.groupBoxRemoteButton.Controls.Add(this.labelRemoteDevice); this.groupBoxRemoteButton.Controls.Add(this.buttonSendRemoteButton); this.groupBoxRemoteButton.Location = new System.Drawing.Point(8, 136); this.groupBoxRemoteButton.Name = "groupBoxRemoteButton"; @@ -167,45 +168,38 @@ this.groupBoxRemoteButton.TabStop = false; this.groupBoxRemoteButton.Text = "Remote button"; // - // labelCustomButton + // textBoxRemoteCode // - this.labelCustomButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelCustomButton.Location = new System.Drawing.Point(136, 16); - this.labelCustomButton.Name = "labelCustomButton"; - this.labelCustomButton.Size = new System.Drawing.Size(144, 20); - this.labelCustomButton.TabIndex = 1; - this.labelCustomButton.Text = "Custom button key code:"; - this.labelCustomButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.textBoxRemoteCode.Location = new System.Drawing.Point(232, 16); + this.textBoxRemoteCode.Name = "textBoxRemoteCode"; + this.textBoxRemoteCode.Size = new System.Drawing.Size(100, 20); + this.textBoxRemoteCode.TabIndex = 7; // - // numericUpDownButton + // textBoxRemoteDevice // - this.numericUpDownButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.numericUpDownButton.Location = new System.Drawing.Point(288, 16); - this.numericUpDownButton.Maximum = new decimal(new int[] { - 32768, - 0, - 0, - 0}); - this.numericUpDownButton.Name = "numericUpDownButton"; - this.numericUpDownButton.Size = new System.Drawing.Size(72, 20); - this.numericUpDownButton.TabIndex = 2; - this.numericUpDownButton.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.numericUpDownButton.ThousandsSeparator = true; - this.toolTips.SetToolTip(this.numericUpDownButton, "Specify a custom button code to forward to the server"); + this.textBoxRemoteDevice.Location = new System.Drawing.Point(64, 16); + this.textBoxRemoteDevice.Name = "textBoxRemoteDevice"; + this.textBoxRemoteDevice.Size = new System.Drawing.Size(100, 20); + this.textBoxRemoteDevice.TabIndex = 6; // - // comboBoxRemoteButtons + // labelRemoteCode // - this.comboBoxRemoteButtons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxRemoteButtons.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxRemoteButtons.FormattingEnabled = true; - this.comboBoxRemoteButtons.Location = new System.Drawing.Point(8, 16); - this.comboBoxRemoteButtons.Name = "comboBoxRemoteButtons"; - this.comboBoxRemoteButtons.Size = new System.Drawing.Size(120, 21); - this.comboBoxRemoteButtons.TabIndex = 0; - this.toolTips.SetToolTip(this.comboBoxRemoteButtons, "Choose a remote control button to forward to the server"); - this.comboBoxRemoteButtons.SelectedIndexChanged += new System.EventHandler(this.comboBoxRemoteButtons_SelectedIndexChanged); + this.labelRemoteCode.Location = new System.Drawing.Point(176, 16); + this.labelRemoteCode.Name = "labelRemoteCode"; + this.labelRemoteCode.Size = new System.Drawing.Size(56, 20); + this.labelRemoteCode.TabIndex = 5; + this.labelRemoteCode.Text = "Code:"; + this.labelRemoteCode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // labelRemoteDevice + // + this.labelRemoteDevice.Location = new System.Drawing.Point(8, 16); + this.labelRemoteDevice.Name = "labelRemoteDevice"; + this.labelRemoteDevice.Size = new System.Drawing.Size(56, 20); + this.labelRemoteDevice.TabIndex = 4; + this.labelRemoteDevice.Text = "Device:"; + this.labelRemoteDevice.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // buttonSendRemoteButton // this.buttonSendRemoteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -299,7 +293,7 @@ this.Load += new System.EventHandler(this.MainForm_Load); this.groupBoxStatus.ResumeLayout(false); this.groupBoxRemoteButton.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).EndInit(); + this.groupBoxRemoteButton.PerformLayout(); this.groupBoxSetup.ResumeLayout(false); this.groupBoxCommands.ResumeLayout(false); this.ResumeLayout(false); @@ -317,16 +311,17 @@ private System.Windows.Forms.ListBox listBoxStatus; private System.Windows.Forms.GroupBox groupBoxStatus; private System.Windows.Forms.GroupBox groupBoxRemoteButton; - private System.Windows.Forms.NumericUpDown numericUpDownButton; - private System.Windows.Forms.ComboBox comboBoxRemoteButtons; private System.Windows.Forms.Button buttonSendRemoteButton; - private System.Windows.Forms.Label labelCustomButton; private System.Windows.Forms.GroupBox groupBoxSetup; private System.Windows.Forms.GroupBox groupBoxCommands; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.ComboBox comboBoxPort; private System.Windows.Forms.ComboBox comboBoxComputer; private System.Windows.Forms.Button buttonHelp; + private System.Windows.Forms.Label labelRemoteCode; + private System.Windows.Forms.Label labelRemoteDevice; + private System.Windows.Forms.TextBox textBoxRemoteCode; + private System.Windows.Forms.TextBox textBoxRemoteDevice; } } Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -135,9 +135,6 @@ _addStatusLine = new DelegateAddStatusLine(AddStatusLine); - comboBoxRemoteButtons.Items.AddRange(Enum.GetNames(typeof(MceButton))); - comboBoxRemoteButtons.SelectedIndex = 0; - comboBoxPort.Items.Clear(); comboBoxPort.Items.Add("None"); comboBoxPort.SelectedIndex = 0; @@ -482,14 +479,6 @@ } } - private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) - { - if (comboBoxRemoteButtons.SelectedItem.ToString().Equals("Custom", StringComparison.OrdinalIgnoreCase)) - numericUpDownButton.Enabled = true; - else - numericUpDownButton.Enabled = false; - } - private void buttonSendRemoteButton_Click(object sender, EventArgs e) { AddStatusLine("Send Remote Button"); @@ -508,11 +497,17 @@ return; } - int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString(), true); - if (keyCode == -1) - keyCode = Decimal.ToInt32(numericUpDownButton.Value); + byte[] deviceNameBytes = Encoding.ASCII.GetBytes(textBoxRemoteDevice.Text); + byte[] keyCodeBytes = Encoding.ASCII.GetBytes(textBoxRemoteCode.Text); - IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, keyCode.ToString()); + byte[] bytes = new byte[8 + deviceNameBytes.Length + keyCodeBytes.Length]; + + BitConverter.GetBytes(deviceNameBytes.Length).CopyTo(bytes, 0); + deviceNameBytes.CopyTo(bytes, 4); + BitConverter.GetBytes(keyCodeBytes.Length).CopyTo(bytes, 4 + deviceNameBytes.Length); + keyCodeBytes.CopyTo(bytes, 8 + deviceNameBytes.Length); + + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, bytes); _client.Send(message); } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -1307,7 +1307,7 @@ string fileName = Path.Combine(Program.FolderMacros, file + Common.FileExtensionMacro); if (File.Exists(fileName)) { - if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if (MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { File.Delete(fileName); listViewMacro.Items.Remove(listViewMacro.SelectedItems[0]); @@ -1340,7 +1340,7 @@ string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string macroName = listViewMacro.SelectedItems[0].Text; - string shortcutPath = Path.Combine(desktopPath, "Macro - " + macroName + ".lnk"); + string shortcutPath = Path.Combine(desktopPath, String.Format("Macro - {0}.lnk", macroName)); MSjogren.Samples.ShellLink.ShellShortcut shortcut = new MSjogren.Samples.ShellLink.ShellShortcut(shortcutPath); @@ -1382,7 +1382,7 @@ string fileName = Path.Combine(Common.FolderIRCommands, file + Common.FileExtensionIR); if (File.Exists(fileName)) { - if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if (MessageBox.Show(this, String.Format("Are you sure you want to delete \"{0}\"?", file), "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { File.Delete(fileName); listViewIR.Items.Remove(listViewIR.SelectedItems[0]); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -197,7 +197,7 @@ if (String.IsNullOrEmpty(subMenuName)) labelHeader.Text = WindowTitle; else - labelHeader.Text = WindowTitle + " - " + subMenuName; + labelHeader.Text = String.Format("{0} - {1}", WindowTitle, subMenuName); } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -26,7 +26,7 @@ #region Constants - static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Virtual Remote Skin Editor\\Virtual Remote Skin Editor.xml"); + static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Virtual Remote\\Virtual Remote Skin Editor.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -491,6 +491,7 @@ process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true); process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); process.StartInfo.UseShellExecute = bool.Parse(commands[5]); + //process.PriorityClass = ProcessPriorityClass. bool waitForExit = bool.Parse(commands[6]); bool forceFocus = bool.Parse(commands[7]); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -24,10 +24,10 @@ { get { - return - textBoxHeading.Text + "|" + - textBoxText.Text + "|" + - numericUpDownTimeout.Value.ToString(); + return String.Format("{0}|{1}|{2}", + textBoxHeading.Text, + textBoxText.Text, + numericUpDownTimeout.Value.ToString()); } } Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -23,12 +23,12 @@ /// <summary> /// Folder for Custom Input Device data files. /// </summary> - public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + Path.DirectorySeparatorChar; + public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice); /// <summary> /// Folder for Input Device data default files. /// </summary> - public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + Path.DirectorySeparatorChar; + public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault); /// <summary> /// Path to the MediaPortal configuration file. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -934,7 +934,7 @@ bool i18n_translate(string orig, IntPtr szstore, int size) { #if TRACE - Trace.WriteLine("i18n_translate(" + orig + ")"); + Trace.WriteLine(String.Format("i18n_translate({0})", orig)); #endif return WriteString(szstore, size, orig); @@ -997,7 +997,7 @@ int get_int_var(string name) { #if TRACE - Trace.WriteLine("get_int_var(" + name + ")"); + Trace.WriteLine(String.Format("get_int_var({0})", name)); #endif return 0; @@ -1006,7 +1006,7 @@ double get_double_var(string name) { #if TRACE - Trace.WriteLine("get_double_var(" + name + ")"); + Trace.WriteLine(String.Format("get_double_var({0})", name)); #endif return 0.0; @@ -1048,7 +1048,7 @@ bool delete_var(string name) { #if TRACE - Trace.WriteLine("delete_var(" + name + ")"); + Trace.WriteLine(String.Format("delete_var({0})", name)); #endif return true; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -5,9 +5,8 @@ #endif using System.IO; using System.Runtime.InteropServices; +using System.Windows.Forms; -using Microsoft.Win32.SafeHandles; - namespace InputService.Plugin { @@ -18,48 +17,38 @@ public class IR507Receiver : PluginBase, IRemoteReceiver { - #region Interop + #region Debug - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] - static extern SafeFileHandle CreateFile( - String fileName, - [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShare fileShare, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, - [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, - IntPtr template); + [STAThread] + static void Main() + { + try + { + IR507Receiver c = new IR507Receiver(); - [Flags] - enum EFileAttributes : uint + c.RemoteCallback += new RemoteHandler(Remote); + c.Start(); + + Application.Run(); + + c.Stop(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + static void Remote(string deviceName, string code) { - 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, + Console.WriteLine("Remote: {0}", code); } + #endregion Debug + + + #region Interop + [StructLayout(LayoutKind.Sequential)] struct DeviceInfoData { @@ -141,9 +130,7 @@ #region Constants - const int DeviceBufferSize = 255; - - //const string DeviceID = "vid_0e6a&pid_6002"; + //const string DeviceID = "vid_0e6a&pid_6002"; // Unknown const string DeviceID = "vid_147a&pid_e02a"; #endregion Constants @@ -152,10 +139,10 @@ RemoteHandler _remoteButtonHandler; - FileStream _deviceStream; - byte[] _deviceBuffer; + ReceiverWindow _receiverWindow; + RawInput.RAWINPUTDEVICE _device; - int _lastCode = -1; + string _lastCode = String.Empty; DateTime _lastCodeTime = DateTime.Now; #endregion Variables @@ -211,28 +198,16 @@ /// </summary> public override void Start() { - Guid guid = new Guid(); - HidD_GetHidGuid(ref guid); + _receiverWindow = new ReceiverWindow("IR507 Receiver"); + _receiverWindow.ProcMsg += new ProcessMessage(ProcMessage); - string devicePath = FindDevice(guid); - if (String.IsNullOrEmpty(devicePath)) - throw new ApplicationException("Device not found"); + _device.usUsage = 1; + _device.usUsagePage = 12; + _device.dwFlags = RawInput.RawInputDeviceFlags.InputSink; + _device.hwndTarget = _receiverWindow.Handle; - //Console.WriteLine("Opening device: {0}", devicePath); - - SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); - int lastError = Marshal.GetLastWin32Error(); - - //Console.WriteLine("Last Error: {0}", lastError); - - if (deviceHandle.IsInvalid) - throw new Win32Exception(lastError, "Failed to open device"); - - //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); - - _deviceBuffer = new byte[DeviceBufferSize]; - _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); - _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + if (!RegisterForRawInput(_device)) + throw new ApplicationException("Failed to register for HID Raw input"); } /// <summary> /// Suspend the IR Server plugin when computer enters standby. @@ -253,21 +228,12 @@ /// </summary> public override void Stop() { - if (_deviceStream == null) - return; + _device.dwFlags |= RawInput.RawInputDeviceFlags.Remove; + RegisterForRawInput(_device); - try - { - _deviceStream.Dispose(); - } - catch (IOException) - { - // we are closing the stream so ignore this - } - finally - { - _deviceStream = null; - } + _receiverWindow.ProcMsg -= new ProcessMessage(ProcMessage); + _receiverWindow.DestroyHandle(); + _receiverWindow = null; } /// <summary> @@ -280,6 +246,70 @@ set { _remoteButtonHandler = value; } } + bool RegisterForRawInput(RawInput.RAWINPUTDEVICE device) + { + RawInput.RAWINPUTDEVICE[] devices = new RawInput.RAWINPUTDEVICE[1]; + devices[0] = device; + + return RegisterForRawInput(devices); + } + bool RegisterForRawInput(RawInput.RAWINPUTDEVICE[] devices) + { + return RawInput.RegisterRawInputDevices(devices, (uint)devices.Length, (uint)Marshal.SizeOf(devices[0])); + } + + void ProcMessage(ref Message m) + { + if (m.Msg != RawInput.WM_INPUT) + return; + + uint dwSize = 0; + + RawInput.GetRawInputData(m.LParam, RawInput.RawInputCommand.Input, IntPtr.Zero, ref dwSize, (uint)Marshal.SizeOf(typeof(RawInput.RAWINPUTHEADER))); + + IntPtr buffer = Marshal.AllocHGlobal((int)dwSize); + try + { + if (buffer == IntPtr.Zero) + return; + + if (RawInput.GetRawInputData(m.LParam, RawInput.RawInputCommand.Input, buffer, ref dwSize, (uint)Marshal.SizeOf(typeof(RawInput.RAWINPUTHEADER))) != dwSize) + return; + + RawInput.RAWINPUT raw = (RawInput.RAWINPUT)Marshal.PtrToStructure(buffer, typeof(RawInput.RAWINPUT)); + + if (raw.header.dwType == RawInput.RawInputType.HID) + { + int offset = Marshal.SizeOf(typeof(RawInput.RAWINPUTHEADER)) + Marshal.SizeOf(typeof(RawInput.RAWHID)); + + byte[] bRawData = new byte[offset + raw.hid.dwSizeHid]; + Marshal.Copy(buffer, bRawData, 0, bRawData.Length); + + byte[] newArray = new byte[raw.hid.dwSizeHid]; + Array.Copy(bRawData, offset, newArray, 0, newArray.Length); + + string code = BitConverter.ToString(newArray); + + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + if (!code.Equals(_lastCode, StringComparison.Ordinal) || timeSpan.Milliseconds > 250) + { + if (_remoteButtonHandler != null) + _remoteButtonHandler(this.Name, code); + + _lastCodeTime = DateTime.Now; + } + + _lastCode = code; + } + } + finally + { + Marshal.FreeHGlobal(buffer); + } + + } + static string FindDevice(Guid classGuid) { int lastError; @@ -349,64 +379,8 @@ return devicePath; } - void OnReadComplete(IAsyncResult asyncResult) - { - try - { - //int read = _deviceStream.EndRead(asyncResult); - //Console.WriteLine(BitConverter.ToString(_deviceBuffer, 0, read)); - - if (_deviceStream.EndRead(asyncResult) == 4 && _deviceBuffer[1] == 0) - { - TimeSpan timeSpan = DateTime.Now - _lastCodeTime; - - int keyCode = (int)_deviceBuffer[2]; - - if (keyCode != _lastCode || timeSpan.Milliseconds > 250) - { - if (_remoteButtonHandler != null) - _remoteButtonHandler(this.Name, keyCode.ToString()); - - _lastCodeTime = DateTime.Now; - } - - _lastCode = keyCode; - } - - _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); - } - catch (Exception) - { - } - } - #endregion Implementation - #region Debug - - [STAThread] - static void Main() - { - try - { - IR507Receiver c = new IR507Receiver(); - c.Start(); - - while (Console.ReadKey().Key != ConsoleKey.Escape) - { - Console.WriteLine("Press escape to quit"); - } - - c.Stop(); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - - #endregion Debug - } } 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 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -111,8 +111,7 @@ this.numericUpDownButtonRepeatDelay.TabIndex = 2; this.numericUpDownButtonRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownButtonRepeatDelay.ThousandsSeparator = true; - this.toolTips.SetToolTip(this.numericUpDownButtonRepeatDelay, "When the button is held this is the time between the first press and the first re" + - "peat"); + this.toolTips.SetToolTip(this.numericUpDownButtonRepeatDelay, "When the button is held this is the time between the first press and the first repeat"); this.numericUpDownButtonRepeatDelay.Value = new decimal(new int[] { 10000, 0, @@ -326,8 +325,7 @@ this.checkBoxDisableMCEServices.Size = new System.Drawing.Size(216, 17); 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.toolTips.SetToolTip(this.checkBoxDisableMCEServices, "Disable Microsoft Windows Media Center services to prevent interference with the Input Service"); this.checkBoxDisableMCEServices.UseVisualStyleBackColor = true; // // checkBoxEnableRemote Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -270,7 +270,7 @@ if (_remoteButtonHandler == null) return; - string buttonCode = cmd.Remote + ": " + cmd.Button; + string buttonCode = String.Format("{0}: {1}", cmd.Remote, cmd.Button); _remoteButtonHandler(this.Name, buttonCode); } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -175,12 +175,12 @@ if (_lastCommand.IsSameCommand(command)) if ((command.Time - _lastCommand.Time) < _buttonReleaseTime) { - Trace.WriteLine("WLirc: Command '" + command.Button + "' ignored because of repeat filter"); + Trace.WriteLine(String.Format("WLirc: Command '{0}' ignored because of repeat filter", command.Button)); return; } #endregion - Trace.WriteLine("WLirc: Command '" + command.Button + "' accepted"); + Trace.WriteLine(String.Format("WLirc: Command '{0}' accepted", command.Button)); _lastCommand = command; if (CommandEvent != null) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.Designer.cs 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.Designer.cs 2008-03-06 14:49:18 UTC (rev 1431) @@ -72,8 +72,7 @@ this.numericUpDownMessageType.TabIndex = 1; this.numericUpDownMessageType.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownMessageType.ThousandsSeparator = true; - this.toolTips.SetToolTip(this.numericUpDownMessageType, "When the button is held this is the time between the first press and the first re" + - "peat"); + this.toolTips.SetToolTip(this.numericUpDownMessageType, "When the button is held this is the time between the first press and the first repeat"); this.numericUpDownMessageType.Value = new decimal(new int[] { 32768, 0, Modified: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-06 00:34:39 UTC (rev 1430) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-06 14:49:18 UTC (rev 1431) @@ -510,9 +510,9 @@ ;====================================== -Section "Virtual Remote and Web Remote" SectionVirtualRemote +Section "Virtual Remote" SectionVirtualRemote - DetailPrint "Installing Virtual Remote and Web Remote..." + DetailPrint "Installing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." ; Use the all users context SetShellVarContext all @@ -522,7 +522,8 @@ SetOutPath "$DIR_INSTALL\Virtual Remote" SetOverwrite ifnewer File "Applications\Virtual Remote\bin\Debug\*.*" - File "Applications\Web Remote\bin\Debug\WebRemote.exe" + File "Applications\Web Remote\bin\Debug\WebRemote.*" + File "Applications\Virtual Remote Skin Editor\bin\Debug\VirtualRemoteSkinEditor.*" ; Installing skins CreateDirectory "$DIR_INSTALL\Virtual Remote\Skins" @@ -543,38 +544,16 @@ ; Create start menu shortcut CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote Skin Editor.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemoteSkinEditor.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemoteSkinEditor.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" "$DIR_INSTALL\Virtual Remote\Smart Devices" CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" "" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" 0 - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" "$DIR_INSTALL\Virtual Remote\Smart Devices" SectionEnd ;====================================== -Section "Virtual Remote Skin Editor" SectionVirtualRemoteSkinEditor +Section "IR Blast" SectionIRBlast - DetailPrint "Installing Virtual Remote Skin Editor ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing Virtual Remote - CreateDirectory "$DIR_INSTALL\Virtual Remote Skin Editor" - SetOutPath "$DIR_INSTALL\Virtual Remote Skin Editor" - SetOverwrite ifnewer - File "Applications\Virtual Remote Skin Editor\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote Skin Editor" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}... [truncated message content] |
From: <an...@us...> - 2008-03-07 08:28:28
|
Revision: 1434 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1434&view=rev Author: and-81 Date: 2008-03-07 00:28:22 -0800 (Fri, 07 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Documentation/Common/debug_client.png trunk/plugins/IR Server Suite/Documentation/Input Service/advanced.png trunk/plugins/IR Server Suite/Documentation/Input Service/configuration.png trunk/plugins/IR Server Suite/Documentation/Translator/programs.png trunk/plugins/IR Server Suite/Documentation/Tray Launcher/setup.png trunk/plugins/IR Server Suite/Documentation/Virtual Remote/virtual_remote.png trunk/plugins/IR Server Suite/Documentation/abstract_remote_model.html trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WiimoteLib/WiimoteLib.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/IgorPlug/Microsoft MCE.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Microsoft MCE/Microsoft MCE.xml trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.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/Config.resx trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Hauppauge/ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Graphics/ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Graphics/Advanced.png trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Graphics/Detect.png trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Graphics/Help.png trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/Resources.resx Property Changed: ---------------- trunk/plugins/ShortcutFileSupport/ Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -1,5 +1,6 @@ using System; using System.Data; +using System.Diagnostics; using System.IO; using System.Net; using System.Text; @@ -150,6 +151,16 @@ case "ZAP": Info("Command: Zap, Channel: {0}", args[1]); + try + { + Info("Raising process priority"); + Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; + } + catch + { + Info("Failed to elevate process priority"); + } + _tvBouquets = new DataTable(); _tvBouquets.ReadXml(DataFile); @@ -168,7 +179,11 @@ DataRow[] rows = _tvBouquets.Select(expression); if (rows.Length == 1) { + //string channelName = rows[0]["ChannelName"] as string; string channelID = rows[0]["ID"] as string; + + //Info("Zapping to channel {0} \"{1}\"", channelName, channelID); + ZapTo(channelID); break; } @@ -255,7 +270,7 @@ _userName = "root"; _password = "dbox2"; _boxType = StbBoxType.Unknown; - _timeout = 2000; + _timeout = 4000; SaveSettings(); } Added: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml 2008-03-07 08:28:22 UTC (rev 1434) @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <ServerHost>localhost</ServerHost> + <SystemWideMappings /> + <Programs> + <ProgramSettings Name="Meedio" FileName="e:\meedio\meedioapp\meedio.exe" Folder="" Arguments="" UseShellExecute="false" ForceWindowFocus="false" IgnoreSystemWide="false" WindowState="Normal"> + <ButtonMappings> + <ButtonMapping KeyCode="Up" Description="UP" Command="Window Message: CLASS|H2-WM-COMMAND|273|1|0" /> + <ButtonMapping KeyCode="Down" Description="DOWN" Command="Window Message: CLASS|H2-WM-COMMAND|273|2|0" /> + <ButtonMapping KeyCode="Left" Description="LEFT" Command="Window Message: CLASS|H2-WM-COMMAND|273|3|0" /> + <ButtonMapping KeyCode="Right" Description="RIGHT" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="OK" Description="SELECT" Command="Window Message: CLASS|H2-WM-COMMAND|273|5|0" /> + <ButtonMapping KeyCode="VolumeUp" Description="VOLUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|30|0" /> + <ButtonMapping KeyCode="VolumeDown" Description="VOLDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|31|0" /> + <ButtonMapping KeyCode="ChannelUp" Description="CHANNELUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|7|0" /> + <ButtonMapping KeyCode="ChannelDown" Description="CHANNELDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|8|0" /> + <ButtonMapping KeyCode="Start" Description="HOME" Command="Window Message: CLASS|H2-WM-COMMAND|273|44|0" /> + <ButtonMapping KeyCode="Back" Description="BACK" Command="Window Message: CLASS|H2-WM-COMMAND|273|6|0" /> + <ButtonMapping KeyCode="Info" Description="INFO" Command="Window Message: CLASS|H2-WM-COMMAND|273|36|0" /> + <ButtonMapping KeyCode="Mute" Description="MUTE" Command="Window Message: CLASS|H2-WM-COMMAND|273|32|0" /> + <ButtonMapping KeyCode="Number0" Description="0" Command="Window Message: CLASS|H2-WM-COMMAND|273|10|0" /> + <ButtonMapping KeyCode="Number1" Description="1" Command="Window Message: CLASS|H2-WM-COMMAND|273|11|0" /> + <ButtonMapping KeyCode="Number2" Description="2" Command="Window Message: CLASS|H2-WM-COMMAND|273|12|0" /> + <ButtonMapping KeyCode="Number3" Description="3" Command="Window Message: CLASS|H2-WM-COMMAND|273|13|0" /> + <ButtonMapping KeyCode="Number4" Description="4" Command="Window Message: CLASS|H2-WM-COMMAND|273|14|0" /> + <ButtonMapping KeyCode="Number5" Description="5" Command="Window Message: CLASS|H2-WM-COMMAND|273|15|0" /> + <ButtonMapping KeyCode="Number6" Description="6" Command="Window Message: CLASS|H2-WM-COMMAND|273|16|0" /> + <ButtonMapping KeyCode="Number7" Description="7" Command="Window Message: CLASS|H2-WM-COMMAND|273|17|0" /> + <ButtonMapping KeyCode="Number8" Description="8" Command="Window Message: CLASS|H2-WM-COMMAND|273|18|0" /> + <ButtonMapping KeyCode="Number9" Description="9" Command="Window Message: CLASS|H2-WM-COMMAND|273|19|0" /> + <ButtonMapping KeyCode="Play" Description="PLAY" Command="Window Message: CLASS|H2-WM-COMMAND|273|21|0" /> + <ButtonMapping KeyCode="Pause" Description="PAUSE" Command="Window Message: CLASS|H2-WM-COMMAND|273|22|0" /> + <ButtonMapping KeyCode="Stop" Description="STOP" Command="Window Message: CLASS|H2-WM-COMMAND|273|27|0" /> + <ButtonMapping KeyCode="FastForward" Description="FFWD" Command="Window Message: CLASS|H2-WM-COMMAND|273|25|0" /> + <ButtonMapping KeyCode="Rewind" Description="REW" Command="Window Message: CLASS|H2-WM-COMMAND|273|26|0" /> + <ButtonMapping KeyCode="Record" Description="RECORD" Command="Window Message: CLASS|H2-WM-COMMAND|273|28|0" /> + <ButtonMapping KeyCode="NextChapter" Description="NEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|23|0" /> + <ButtonMapping KeyCode="PreviousChapter" Description="PREVIOUS" Command="Window Message: CLASS|H2-WM-COMMAND|273|24|0" /> + <ButtonMapping KeyCode="Power" Description="POWER" Command="Window Message: CLASS|H2-WM-COMMAND|273|38|0" /> + <ButtonMapping KeyCode="Power2" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Teletext" Description="TELETEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|52|0" /> + <ButtonMapping KeyCode="Red" Description="RED" Command="Window Message: CLASS|H2-WM-COMMAND|273|53|0" /> + <ButtonMapping KeyCode="Green" Description="GREEN" Command="Window Message: CLASS|H2-WM-COMMAND|273|54|0" /> + <ButtonMapping KeyCode="Yellow" Description="YELLOW" Command="Window Message: CLASS|H2-WM-COMMAND|273|55|0" /> + <ButtonMapping KeyCode="Blue" Description="BLUE" Command="Window Message: CLASS|H2-WM-COMMAND|273|56|0" /> + <ButtonMapping KeyCode="Clear" Description="CLEAR" Command="Window Message: CLASS|H2-WM-COMMAND|273|39|0" /> + <ButtonMapping KeyCode="Enter" Description="ENTER" Command="Window Message: CLASS|H2-WM-COMMAND|273|20|0" /> + <ButtonMapping KeyCode="_Hash" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="_Star" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Music" Description="GOTO-MUSIC" Command="Window Message: CLASS|H2-WM-COMMAND|273|46|0" /> + <ButtonMapping KeyCode="Pictures" Description="GOTO-PHOTOS" Command="Window Message: CLASS|H2-WM-COMMAND|273|47|0" /> + <ButtonMapping KeyCode="Videos" Description="GOTO-VIDEO" Command="Window Message: CLASS|H2-WM-COMMAND|273|50|0" /> + <ButtonMapping KeyCode="DVD" Description="GOTO-DVD" Command="Window Message: CLASS|H2-WM-COMMAND|273|48|0" /> + <ButtonMapping KeyCode="TV" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Guide" Description="GUIDE" Command="Window Message: CLASS|H2-WM-COMMAND|273|34|0" /> + <ButtonMapping KeyCode="LiveTV" Description="GOTO-TV" Command="Window Message: CLASS|H2-WM-COMMAND|273|49|0" /> + <ButtonMapping KeyCode="PreviousChannel" Description="PREV-CH" Command="Window Message: CLASS|H2-WM-COMMAND|273|33|0" /> + <ButtonMapping KeyCode="_Radio" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="_Print" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + </ButtonMappings> + </ProgramSettings> + </Programs> + <Events /> +</Configuration> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -516,6 +516,13 @@ private void buttonTest_Click(object sender, EventArgs e) { + if (String.IsNullOrEmpty(_command)) + { + MessageBox.Show(this, "You must Set the command before you can Test it", "No command Set", MessageBoxButtons.OK, MessageBoxIcon.Warning); + buttonSet.Focus(); + return; + } + if (_command.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) { MessageBox.Show(this, "Keystroke commands cannot be tested here", "Cannot test Keystroke command", MessageBoxButtons.OK, MessageBoxIcon.Stop); Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -25,8 +25,6 @@ #region Constants - const string DefaultKeyCode = "31730"; - static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Tray Launcher\\Tray Launcher.xml"); #endregion Constants @@ -246,10 +244,10 @@ } void CreateDefaultSettings() { - _serverHost = "localhost"; - _programFile = String.Empty; - _launchOnLoad = false; - _launchKeyCode = DefaultKeyCode; + _serverHost = "localhost"; + _programFile = String.Empty; + _launchOnLoad = false; + _launchKeyCode = "Start"; SaveSettings(); } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -387,7 +387,7 @@ BitConverter.GetBytes(keyCodeBytes.Length).CopyTo(bytes, 4 + deviceNameBytes.Length); keyCodeBytes.CopyTo(bytes, 8 + deviceNameBytes.Length); - IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, bytes); + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, bytes); SendMessage(message); } Modified: trunk/plugins/IR Server Suite/Documentation/Common/debug_client.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/Input Service/advanced.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/Input Service/configuration.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/Translator/programs.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/Tray Launcher/setup.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/virtual_remote.png =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Documentation/abstract_remote_model.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/abstract_remote_model.html 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Documentation/abstract_remote_model.html 2008-03-07 08:28:22 UTC (rev 1434) @@ -24,6 +24,12 @@ <P>What follows is the Abstract Remote Model button list as of Version 0.1 of the Abstract Remote Model.</P> +<!-- + + + +--> + <TABLE> <TR><TD>Abstract Button Name</TD><TD>Brief description</TD><TD>Explanation</TD></TR> <TR><TD>Up</TD><TD>Up Arrow</TD><TD>A feature of almost all PC remote controls, the arrow buttons are generally used to control the on screen cursor or item selection.</TD></TR> @@ -35,6 +41,7 @@ <TR><TD>VolumeDown</TD><TD>Decrease Volume</TD><TD>Decrease the system or application volume.</TD></TR> <TR><TD>ChannelUp</TD><TD>Channel Up</TD><TD>In TV systems this button is used to increment the channel.</TD></TR> <TR><TD>ChannelDown</TD><TD>Channel Down</TD><TD>In TV systems this button is used to decrement the channel.</TD></TR> +<TR><TD>PreviousChannel</TD><TD>Return to the Previous Channel</TD><TD>In TV systems this button is used to go back to the last channel.</TD></TR> <TR><TD>Start</TD><TD>Start / Home / Go</TD><TD>This button may appear under many labels, in MCE convention it is referred to as the Start button and is used to launch a common application or while in that application it is also used to return to the main menu or home screen.</TD></TR> <TR><TD>Back</TD><TD>Back</TD><TD>Often mapped as the keyboard Escape key, this buttons most common function is to leave a menu or abort an operation or selection.</TD></TR> <TR><TD>Info</TD><TD>Info / More</TD><TD> @@ -71,7 +78,7 @@ <TR><TD>Clear</TD><TD>Clear / Delete</TD><TD>Clear a text entry or delete a single character (backspace).</TD></TR> <TR><TD>Enter</TD><TD>Enter</TD><TD>Simulates a keyboard Enter button press, or is used to add a carriage return to a block of text, where as pressing OK/Select would finish the text entry mode.</TD></TR> <TR><TD>Hash</TD><TD>#</TD><TD>Used for special functions in alpha-numeric text entry modes. Or simply as a special character.</TD></TR> -<TR><TD>Star</TD><TD>*</TD><TD> +<TR><TD>Star</TD><TD>*</TD><TD>Used for special functions in alpha-numeric text entry modes. Or simply as a special character.</TD></TR> <TR><TD>TaskSwap</TD><TD>Task Swap / Alt-Tab</TD><TD>Used to switch between running applications on the PC.</TD></TR> <TR><TD>Fullscreen</TD><TD>Toggle Fullscreen</TD><TD>Toggle video playback or window size between fullscreen and windowed.</TD></TR> <TR><TD>AspectRatio</TD><TD>Toggle Aspect Ratio</TD><TD>Cycle the video aspect ratio between available values.</TD></TR> @@ -83,6 +90,7 @@ <TR><TD>TV</TD><TD>Television</TD><TD>Go to the Television section of a program, or used to launch a television application.</TD></TR> <TR><TD>Guide</TD><TD>Guide / EPG</TD><TD>Go to the Guide or EPG section of a program.</TD></TR> <TR><TD>LiveTV</TD><TD>Live TV</TD><TD>Go to the Live TV section of a program, or used to launch a live TV application.</TD></TR> +<TR><TD>RecordedTV</TD><TD>Recorded TV programs</TD><TD>Go to the Recorded TV section of a program, or used to launch a video playback application.</TD></TR> <TR><TD>Radio</TD><TD>Radio</TD><TD>Go to the Radio section of a program, or used to launch a radio application.</TD></TR> <TR><TD>Print</TD><TD>Print</TD><TD>Print the current view/document.</TD></TR> <TR><TD>Snapshot</TD><TD>Create Snapshot</TD><TD>Create an image snapshot of the current view.</TD></TR> Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-07 08:28:22 UTC (rev 1434) @@ -24,7 +24,7 @@ <LI>Installer: New IR Server Suite installer. It looks more professional and you can now change the MediaPortal plugin install paths.</LI> <LI>General: Fixed the "pause" macro command.</LI> <LI>MCE Transceiver: Fixed another XP and Vista suspend/resume bug. When will it all end? ;)</LI> -<LI>IR Server plugins: Modified some method signatures.</LI> +<LI>Input plugins: Modified some method signatures.</LI> <LI>TV3 Blaster Plugin: Fixed a fatal error.</LI> <LI>General: Anywhere that previously took user input for a command and could include escape codes can now also include Environment Variables (including clipboard contents, date, time, and others). See documentation for more info.</LI> <LI>IR Blast: Now defaults to "localhost" if no host is specified on the command line (this will make it simpler to use on most setups).</LI> @@ -34,7 +34,7 @@ <LI>Translator: Can create a shortcut on the users desktop to launch a macro.</LI> <LI>Documentation: New documentation areas (Troubleshooting FAQ) and improvements.</LI> <LI>MCE Remote Receiver: Can now set remote and keyboard repeat rates to mimic system keyboard repeat rate settings.</LI> -<LI>IR Server Plugin: Added support for HCW (Hauppauge) Receiver - Experimental.</LI> +<LI>New Input Plugin: Added support for HCW (Hauppauge) Receiver - Experimental.</LI> <LI>Translator: Added a "remap" button for changing the button associated with a command.</LI> <LI>IR Server Plugin: Added support for RC102 and compatible receivers - Experimental.</LI> <LI>TCP Comms: Automatically maps "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a host name lookup problem for some users.</LI> @@ -45,6 +45,9 @@ <LI>New Input Plugin: Direct Input. This allows the user to map game controllers (gamepads, joysticks, etc...) as remotes. First version is basic, next version will allow button combos and controlling the mouse with analog sticks.</LI> <LI>General: Implemented first draft of Abstract Remote Model. This will be expanded on in Version 1.0.4.3 to provide a superior automatic configuration method for all Applications and Plugins.</LI> <LI>MCE Transceiver: No longer sends those remote buttons that are being automatically handled, if automatic handling is disabled it will send the full set. This will prevent double presses from occuring. Note that this only effects the buttons that are automatically handled, the other buttons will continue to be sent regardless.</LI> +<LI>New Input Plugin: Added Experimental Mac Mini receiver support.</LI> +<LI>New Input Plugin: Added Experimental Leadtek CoolCommand receiver support.</LI> +<LI>New Input Plugin: Added Experimental Technotrend Receiver support.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-03-07 08:28:22 UTC (rev 1434) @@ -33,10 +33,16 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Drawing" /> </ItemGroup> <ItemGroup> <Compile Include="AdsTechPTV335Receiver.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> @@ -48,6 +54,13 @@ <ItemGroup> <Content Include="Icon.ico" /> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -1,4 +1,5 @@ using System; +using System.Drawing; using System.Text; using System.Threading; using System.Runtime.InteropServices; @@ -64,6 +65,11 @@ /// </summary> /// <value>The description.</value> public override string Description { get { return "Supports the Ads Tech PTV-335 Receiver"; } } + /// <summary> + /// Gets a display icon for the plugin. + /// </summary> + /// <value>The icon.</value> + public override Icon DeviceIcon { get { return Properties.Resources.Icon; } } /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Icon.ico =================================================================== (Binary files differ) Added: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.Designer.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace InputService.Plugin.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InputService.Plugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Properties/Resources.resx 2008-03-07 08:28:22 UTC (rev 1434) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="Icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\icon.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-03-07 08:28:22 UTC (rev 1434) @@ -17,7 +17,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> @@ -36,26 +36,6 @@ <UseVSHostingProcess>false</UseVSHostingProcess> <DebugSymbols>false</DebugSymbols> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>TRACE;DEBUG</DefineConstants> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DebugType>full</DebugType> - <PlatformTarget>x86</PlatformTarget> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - <DocumentationFile>bin\x86\Debug\CoolCommand Receiver.xml</DocumentationFile> - </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.Drawing" /> @@ -65,6 +45,11 @@ <ItemGroup> <Compile Include="CoolCommandReceiver.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> <Compile Include="ReceiverWindow.cs" /> </ItemGroup> <ItemGroup> @@ -77,6 +62,13 @@ <ItemGroup> <Content Include="Icon.ico" /> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-03-07 05:08:44 UTC (rev 1433) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -5,6 +5,7 @@ #if TRACE using System.Diagnostics; #endif +using System.Drawing; using System.IO; using System.Runtime.InteropServices; using System.Text; @@ -63,6 +64,11 @@ /// </summary> /// <value>The description.</value> public override string Description { get { return "Leadtek Winfast CoolCommand Receiver"; } } + /// <summary> + /// Gets a display icon for the plugin. + /// </summary> + /// <value>The icon.</value> + public override Icon DeviceIcon { get { return Properties.Resources.Icon; } } /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico =================================================================== (Binary files differ) Added: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.Designer.cs 2008-03-07 08:28:22 UTC (rev 1434) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace InputService.Plugin.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InputService.Plugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/Resources.resx 2008-03-07 08:28:22 UTC (rev 1434) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:st... [truncated message content] |
From: <an...@us...> - 2008-03-09 13:19:40
|
Revision: 1440 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1440&view=rev Author: and-81 Date: 2008-03-09 06:19:30 -0700 (Sun, 09 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/ttBdaDrvApi_Dll.dll trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/AppProfile.cs trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Media Player Classic.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.xml trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.resx Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -20,7 +20,10 @@ namespace Abstractor { - public partial class MainForm : Form + /// <summary> + /// Main Form. + /// </summary> + partial class MainForm : Form { #region Constants @@ -100,7 +103,7 @@ "Page Down" };*/ - static readonly string AbstractRemoteMapFolder = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps"); + static readonly string AbstractRemoteMapFolder = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps"); static readonly string AbstractRemoteSchemaFile = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps\\RemoteTable.xsd"); #endregion Constants @@ -118,6 +121,7 @@ VolumeDown, ChannelUp, ChannelDown, + PreviousChannel, Start, Back, Info, @@ -158,6 +162,8 @@ TaskSwap, Fullscreen, AspectRatio, + Display, + Preview, Setup, Music, Pictures, @@ -176,6 +182,8 @@ ScrollDown, PageUp, PageDown, + PictureInPicture, + } #endregion Enumerations Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Program.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -4,8 +4,10 @@ namespace Abstractor { + static class Program { + /// <summary> /// The main entry point for the application. /// </summary> @@ -16,5 +18,7 @@ Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } + } -} \ No newline at end of file + +} Added: trunk/plugins/IR Server Suite/Applications/Translator/AppProfile.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/AppProfile.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/AppProfile.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,166 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Xml.Serialization; + +using IrssUtils; + +namespace Translator +{ + + /// <summary> + /// Holds profile settings for a program that Translator can load. + /// </summary> + [XmlRoot] + public class AppProfile + { + + #region Enumerations + + /// <summary> + /// Detection Method. + /// </summary> + public enum DetectionMethod + { + /// <summary> + /// Match the exe name. + /// </summary> + Executable, + /// <summary> + /// Match the existence of a registry key. + /// </summary> + RegistryExist, + /// <summary> + /// Match a registry key value. + /// </summary> + RegistryValue, + /// <summary> + /// Match details of the file. + /// </summary> + FileDetails, + } + + #endregion Enumerations + + #region Variables + + string _name; + DetectionMethod _matchType; + string _matchParameters; + + List<ButtonMapping> _buttonMappings; + + #endregion Variables + + #region Properties + + /// <summary> + /// Profile name. + /// </summary> + /// <value>The name.</value> + [XmlElement] + public string Name + { + get { return _name; } + set { _name = value; } + } + + /// <summary> + /// Program file name. + /// </summary> + [XmlElement] + public DetectionMethod MatchType + { + get { return _matchType; } + set { _matchType = value; } + } + + /// <summary> + /// Program start folder. + /// </summary> + [XmlElement] + public string MatchParameters + { + get { return _matchParameters; } + set { _matchParameters = value; } + } + + /// <summary> + /// Gets a list of button mappings associated with this program. + /// </summary> + [XmlArray] + public List<ButtonMapping> ButtonMappings + { + get { return _buttonMappings; } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="AppProfile"/> class. + /// </summary> + public AppProfile() + { + _name = String.Empty; + _matchType = DetectionMethod.Executable; + _matchParameters = String.Empty; + _buttonMappings = new List<ButtonMapping>(); + } + + #endregion Constructors + + #region Static Methods + + /// <summary> + /// Save the supplied AppProfile to file. + /// </summary> + /// <param name="profile">AppProfile to save.</param> + /// <param name="fileName">File to save to.</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + internal static bool Save(AppProfile profile, string fileName) + { + try + { + XmlSerializer writer = new XmlSerializer(typeof(AppProfile)); + using (StreamWriter file = new StreamWriter(fileName)) + writer.Serialize(file, profile); + + return true; + } + catch (Exception ex) + { + IrssLog.Error(ex); + return false; + } + } + + /// <summary> + /// Load a configuration file. + /// </summary> + /// <param name="fileName">File to load from.</param> + /// <returns>Loaded Configuration.</returns> + internal static AppProfile Load(string fileName) + { + try + { + XmlSerializer reader = new XmlSerializer(typeof(AppProfile)); + using (StreamReader file = new StreamReader(fileName)) + return (AppProfile)reader.Deserialize(file); + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + + return null; + } + + #endregion Static Methods + + } + +} Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <ButtonMappings> - <ButtonMapping KeyCode="31743" Description="0" Command="Keys: {NUM0}" /> - <ButtonMapping KeyCode="31742" Description="1" Command="Keys: {NUM1}" /> - <ButtonMapping KeyCode="31741" Description="2" Command="Keys: {NUM2}" /> - <ButtonMapping KeyCode="31740" Description="3" Command="Keys: {NUM3}" /> - <ButtonMapping KeyCode="31739" Description="4" Command="Keys: {NUM4}" /> - <ButtonMapping KeyCode="31738" Description="5" Command="Keys: {NUM5}" /> - <ButtonMapping KeyCode="31737" Description="6" Command="Keys: {NUM6}" /> - <ButtonMapping KeyCode="31736" Description="7" Command="Keys: {NUM7}" /> - <ButtonMapping KeyCode="31735" Description="8" Command="Keys: {NUM8}" /> - <ButtonMapping KeyCode="31734" Description="9" Command="Keys: {NUM9}" /> - <ButtonMapping KeyCode="31713" Description="UP" Command="Keys: {UP}" /> - <ButtonMapping KeyCode="31712" Description="DOWN" Command="Keys: {DOWN}" /> - <ButtonMapping KeyCode="31711" Description="LEFT" Command="Keys: {LEFT}" /> - <ButtonMapping KeyCode="31710" Description="RIGHT" Command="Keys: {RIGHT}" /> - <ButtonMapping KeyCode="31709" Description="OK" Command="Keys: {ENTER}" /> - <ButtonMapping KeyCode="31722" Description="REW" Command="Keys: ^d" /> - <ButtonMapping KeyCode="31723" Description="FF" Command="Keys: ^f" /> - <ButtonMapping KeyCode="31721" Description="PLAY" Command="Keys: ^p" /> - <ButtonMapping KeyCode="31719" Description="PAUSE" Command="Keys: ^q" /> - <ButtonMapping KeyCode="31718" Description="STOP" Command="Keys: ^s" /> - <ButtonMapping KeyCode="31720" Description="RECORD" Command="Keys: ^k" /> - <ButtonMapping KeyCode="31716" Description="Track-" Command="Keys: ^{LEFT}" /> - <ButtonMapping KeyCode="31717" Description="Track+" Command="Keys: ^{RIGHT}" /> - <ButtonMapping KeyCode="31708" Description="Back" Command="Keys: {ESC}" /> - <ButtonMapping KeyCode="31728" Description="Info" Command="Keys: ^b" /> - <ButtonMapping KeyCode="31725" Description="Ch+" Command="Keys: {PGUP}" /> - <ButtonMapping KeyCode="31724" Description="Ch-" Command="Keys: {PGDN}" /> - <ButtonMapping KeyCode="31671" Description="Recorded TV" Command="Keys: {F8}" /> - <ButtonMapping KeyCode="31705" Description="Guide" Command="Keys: {F1}" /> - <ButtonMapping KeyCode="31706" Description="Live TV" Command="Keys: {F2}" /> - <ButtonMapping KeyCode="31730" Description="Last Channel" Command="Keys: ^w" /> - <ButtonMapping KeyCode="31714" Description="Videos" Command="Keys: {F3}" /> - <ButtonMapping KeyCode="31715" Description="Radio" Command="Keys: {F6}" /> - <ButtonMapping KeyCode="31732" Description="Audio" Command="Keys: {F4}" /> - <ButtonMapping KeyCode="31731" Description="Main Menu" Command="Keys: {HOME}" /> - </ButtonMappings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.xml (from rev 1439, trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml) =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<AppProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Name>GBPVR</Name> + <MatchType>Executable</MatchType> + <MatchParameters>gbpvr.exe</MatchParameters> + <ButtonMappings> + <ButtonMapping KeyCode="31743" Description="0" Command="Keys: {NUM0}" /> + <ButtonMapping KeyCode="31742" Description="1" Command="Keys: {NUM1}" /> + <ButtonMapping KeyCode="31741" Description="2" Command="Keys: {NUM2}" /> + <ButtonMapping KeyCode="31740" Description="3" Command="Keys: {NUM3}" /> + <ButtonMapping KeyCode="31739" Description="4" Command="Keys: {NUM4}" /> + <ButtonMapping KeyCode="31738" Description="5" Command="Keys: {NUM5}" /> + <ButtonMapping KeyCode="31737" Description="6" Command="Keys: {NUM6}" /> + <ButtonMapping KeyCode="31736" Description="7" Command="Keys: {NUM7}" /> + <ButtonMapping KeyCode="31735" Description="8" Command="Keys: {NUM8}" /> + <ButtonMapping KeyCode="31734" Description="9" Command="Keys: {NUM9}" /> + <ButtonMapping KeyCode="31713" Description="UP" Command="Keys: {UP}" /> + <ButtonMapping KeyCode="31712" Description="DOWN" Command="Keys: {DOWN}" /> + <ButtonMapping KeyCode="31711" Description="LEFT" Command="Keys: {LEFT}" /> + <ButtonMapping KeyCode="31710" Description="RIGHT" Command="Keys: {RIGHT}" /> + <ButtonMapping KeyCode="31709" Description="OK" Command="Keys: {ENTER}" /> + <ButtonMapping KeyCode="31722" Description="REW" Command="Keys: ^d" /> + <ButtonMapping KeyCode="31723" Description="FF" Command="Keys: ^f" /> + <ButtonMapping KeyCode="31721" Description="PLAY" Command="Keys: ^p" /> + <ButtonMapping KeyCode="31719" Description="PAUSE" Command="Keys: ^q" /> + <ButtonMapping KeyCode="31718" Description="STOP" Command="Keys: ^s" /> + <ButtonMapping KeyCode="31720" Description="RECORD" Command="Keys: ^k" /> + <ButtonMapping KeyCode="31716" Description="Track-" Command="Keys: ^{LEFT}" /> + <ButtonMapping KeyCode="31717" Description="Track+" Command="Keys: ^{RIGHT}" /> + <ButtonMapping KeyCode="31708" Description="Back" Command="Keys: {ESC}" /> + <ButtonMapping KeyCode="31728" Description="Info" Command="Keys: ^b" /> + <ButtonMapping KeyCode="31725" Description="Ch+" Command="Keys: {PGUP}" /> + <ButtonMapping KeyCode="31724" Description="Ch-" Command="Keys: {PGDN}" /> + <ButtonMapping KeyCode="31671" Description="Recorded TV" Command="Keys: {F8}" /> + <ButtonMapping KeyCode="31705" Description="Guide" Command="Keys: {F1}" /> + <ButtonMapping KeyCode="31706" Description="Live TV" Command="Keys: {F2}" /> + <ButtonMapping KeyCode="31730" Description="Last Channel" Command="Keys: ^w" /> + <ButtonMapping KeyCode="31714" Description="Videos" Command="Keys: {F3}" /> + <ButtonMapping KeyCode="31715" Description="Radio" Command="Keys: {F6}" /> + <ButtonMapping KeyCode="31732" Description="Audio" Command="Keys: {F4}" /> + <ButtonMapping KeyCode="31731" Description="Main Menu" Command="Keys: {HOME}" /> + </ButtonMappings> +</AppProfile> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Media Player Classic.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Media Player Classic.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Media Player Classic.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<AppProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Name>Media Player Classic</Name> + <MatchType>Executable</MatchType> + <MatchParameters>mplayerc.exe</MatchParameters> + <ButtonMappings> + <ButtonMapping KeyCode="Up" Description="Up Arrow" Command="Keys: {UP}" /> + <ButtonMapping KeyCode="Down" Description="Down Arrow" Command="Keys: {DOWN}" /> + <ButtonMapping KeyCode="Left" Description="Left Arrow" Command="Keys: {LEFT}" /> + <ButtonMapping KeyCode="Right" Description="Right Arrow" Command="Keys: {RIGHT}" /> + <ButtonMapping KeyCode="OK" Description="OK" Command="Keys: {ENTER}" /> + <ButtonMapping KeyCode="Play" Description="Play" Command="Window Message: ACTIVE|*|273|887|0" /> + <ButtonMapping KeyCode="Pause" Description="Pause" Command="Window Message: ACTIVE|*|273|888|0" /> + <ButtonMapping KeyCode="PlayPause" Description="Play/Pause" Command="Window Message: ACTIVE|*|157|00000|0" /> + <ButtonMapping KeyCode="Stop" Description="Stop" Command="Window Message: ACTIVE|*|273|890|0" /> + <ButtonMapping KeyCode="NextChapter" Description="Next" Command="Window Message: ACTIVE|*|273|165|0" /> + <ButtonMapping KeyCode="PreviousChapter" Description="Previous" Command="Window Message: ACTIVE|*|273|164|0" /> + <ButtonMapping KeyCode="DVD" Description="Open DVD" Command="Window Message: ACTIVE|*|273|801|0" /> + <ButtonMapping KeyCode="Open" Description="Open File" Command="Window Message: ACTIVE|*|273|968|0" /> + <ButtonMapping KeyCode="Fullscreen" Description="Toggle Fullscreen" Command="Window Message: ACTIVE|*|273|830|0" /> + <ButtonMapping KeyCode="VolumeUp" Description="Volume Up" Command="Window Message: ACTIVE|*|273|907|0" /> + <ButtonMapping KeyCode="VolumeDown" Description="Volume Down" Command="Window Message: ACTIVE|*|273|908|0" /> + <ButtonMapping KeyCode="Mute" Description="Mute" Command="Window Message: ACTIVE|*|273|909|0" /> + <ButtonMapping KeyCode="Info" Description="Properties" Command="Window Message: ACTIVE|*|273|814|0" /> + <ButtonMapping KeyCode="Screenshot" Description="Capture Screenshot" Command="Window Message: ACTIVE|*|273|807|0" /> + </ButtonMappings> +</AppProfile> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <ButtonMappings> - <ButtonMapping KeyCode="Up" Description="UP" Command="Window Message: CLASS|H2-WM-COMMAND|273|1|0" /> - <ButtonMapping KeyCode="Down" Description="DOWN" Command="Window Message: CLASS|H2-WM-COMMAND|273|2|0" /> - <ButtonMapping KeyCode="Left" Description="LEFT" Command="Window Message: CLASS|H2-WM-COMMAND|273|3|0" /> - <ButtonMapping KeyCode="Right" Description="RIGHT" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="OK" Description="SELECT" Command="Window Message: CLASS|H2-WM-COMMAND|273|5|0" /> - <ButtonMapping KeyCode="VolumeUp" Description="VOLUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|30|0" /> - <ButtonMapping KeyCode="VolumeDown" Description="VOLDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|31|0" /> - <ButtonMapping KeyCode="ChannelUp" Description="CHANNELUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|7|0" /> - <ButtonMapping KeyCode="ChannelDown" Description="CHANNELDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|8|0" /> - <ButtonMapping KeyCode="Start" Description="HOME" Command="Window Message: CLASS|H2-WM-COMMAND|273|44|0" /> - <ButtonMapping KeyCode="Back" Description="BACK" Command="Window Message: CLASS|H2-WM-COMMAND|273|6|0" /> - <ButtonMapping KeyCode="Info" Description="INFO" Command="Window Message: CLASS|H2-WM-COMMAND|273|36|0" /> - <ButtonMapping KeyCode="Mute" Description="MUTE" Command="Window Message: CLASS|H2-WM-COMMAND|273|32|0" /> - <ButtonMapping KeyCode="Number0" Description="0" Command="Window Message: CLASS|H2-WM-COMMAND|273|10|0" /> - <ButtonMapping KeyCode="Number1" Description="1" Command="Window Message: CLASS|H2-WM-COMMAND|273|11|0" /> - <ButtonMapping KeyCode="Number2" Description="2" Command="Window Message: CLASS|H2-WM-COMMAND|273|12|0" /> - <ButtonMapping KeyCode="Number3" Description="3" Command="Window Message: CLASS|H2-WM-COMMAND|273|13|0" /> - <ButtonMapping KeyCode="Number4" Description="4" Command="Window Message: CLASS|H2-WM-COMMAND|273|14|0" /> - <ButtonMapping KeyCode="Number5" Description="5" Command="Window Message: CLASS|H2-WM-COMMAND|273|15|0" /> - <ButtonMapping KeyCode="Number6" Description="6" Command="Window Message: CLASS|H2-WM-COMMAND|273|16|0" /> - <ButtonMapping KeyCode="Number7" Description="7" Command="Window Message: CLASS|H2-WM-COMMAND|273|17|0" /> - <ButtonMapping KeyCode="Number8" Description="8" Command="Window Message: CLASS|H2-WM-COMMAND|273|18|0" /> - <ButtonMapping KeyCode="Number9" Description="9" Command="Window Message: CLASS|H2-WM-COMMAND|273|19|0" /> - <ButtonMapping KeyCode="Play" Description="PLAY" Command="Window Message: CLASS|H2-WM-COMMAND|273|21|0" /> - <ButtonMapping KeyCode="Pause" Description="PAUSE" Command="Window Message: CLASS|H2-WM-COMMAND|273|22|0" /> - <ButtonMapping KeyCode="Stop" Description="STOP" Command="Window Message: CLASS|H2-WM-COMMAND|273|27|0" /> - <ButtonMapping KeyCode="FastForward" Description="FFWD" Command="Window Message: CLASS|H2-WM-COMMAND|273|25|0" /> - <ButtonMapping KeyCode="Rewind" Description="REW" Command="Window Message: CLASS|H2-WM-COMMAND|273|26|0" /> - <ButtonMapping KeyCode="Record" Description="RECORD" Command="Window Message: CLASS|H2-WM-COMMAND|273|28|0" /> - <ButtonMapping KeyCode="NextChapter" Description="NEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|23|0" /> - <ButtonMapping KeyCode="PreviousChapter" Description="PREVIOUS" Command="Window Message: CLASS|H2-WM-COMMAND|273|24|0" /> - <ButtonMapping KeyCode="Power" Description="POWER" Command="Window Message: CLASS|H2-WM-COMMAND|273|38|0" /> - <ButtonMapping KeyCode="Power2" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="Teletext" Description="TELETEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|52|0" /> - <ButtonMapping KeyCode="Red" Description="RED" Command="Window Message: CLASS|H2-WM-COMMAND|273|53|0" /> - <ButtonMapping KeyCode="Green" Description="GREEN" Command="Window Message: CLASS|H2-WM-COMMAND|273|54|0" /> - <ButtonMapping KeyCode="Yellow" Description="YELLOW" Command="Window Message: CLASS|H2-WM-COMMAND|273|55|0" /> - <ButtonMapping KeyCode="Blue" Description="BLUE" Command="Window Message: CLASS|H2-WM-COMMAND|273|56|0" /> - <ButtonMapping KeyCode="Clear" Description="CLEAR" Command="Window Message: CLASS|H2-WM-COMMAND|273|39|0" /> - <ButtonMapping KeyCode="Enter" Description="ENTER" Command="Window Message: CLASS|H2-WM-COMMAND|273|20|0" /> - <ButtonMapping KeyCode="_Hash" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="_Star" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="Music" Description="GOTO-MUSIC" Command="Window Message: CLASS|H2-WM-COMMAND|273|46|0" /> - <ButtonMapping KeyCode="Pictures" Description="GOTO-PHOTOS" Command="Window Message: CLASS|H2-WM-COMMAND|273|47|0" /> - <ButtonMapping KeyCode="Videos" Description="GOTO-VIDEO" Command="Window Message: CLASS|H2-WM-COMMAND|273|50|0" /> - <ButtonMapping KeyCode="DVD" Description="GOTO-DVD" Command="Window Message: CLASS|H2-WM-COMMAND|273|48|0" /> - <ButtonMapping KeyCode="TV" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="Guide" Description="GUIDE" Command="Window Message: CLASS|H2-WM-COMMAND|273|34|0" /> - <ButtonMapping KeyCode="LiveTV" Description="GOTO-TV" Command="Window Message: CLASS|H2-WM-COMMAND|273|49|0" /> - <ButtonMapping KeyCode="PreviousChannel" Description="PREV-CH" Command="Window Message: CLASS|H2-WM-COMMAND|273|33|0" /> - <ButtonMapping KeyCode="_Radio" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - <ButtonMapping KeyCode="_Print" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> - </ButtonMappings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.xml (from rev 1439, trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.exe.xml) =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Meedio.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<AppProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Name>Meedio</Name> + <MatchType>Executable</MatchType> + <MatchParameters>meedio.exe</MatchParameters> + <ButtonMappings> + <ButtonMapping KeyCode="Up" Description="UP" Command="Window Message: CLASS|H2-WM-COMMAND|273|1|0" /> + <ButtonMapping KeyCode="Down" Description="DOWN" Command="Window Message: CLASS|H2-WM-COMMAND|273|2|0" /> + <ButtonMapping KeyCode="Left" Description="LEFT" Command="Window Message: CLASS|H2-WM-COMMAND|273|3|0" /> + <ButtonMapping KeyCode="Right" Description="RIGHT" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="OK" Description="SELECT" Command="Window Message: CLASS|H2-WM-COMMAND|273|5|0" /> + <ButtonMapping KeyCode="VolumeUp" Description="VOLUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|30|0" /> + <ButtonMapping KeyCode="VolumeDown" Description="VOLDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|31|0" /> + <ButtonMapping KeyCode="ChannelUp" Description="CHANNELUP" Command="Window Message: CLASS|H2-WM-COMMAND|273|7|0" /> + <ButtonMapping KeyCode="ChannelDown" Description="CHANNELDN" Command="Window Message: CLASS|H2-WM-COMMAND|273|8|0" /> + <ButtonMapping KeyCode="Start" Description="HOME" Command="Window Message: CLASS|H2-WM-COMMAND|273|44|0" /> + <ButtonMapping KeyCode="Back" Description="BACK" Command="Window Message: CLASS|H2-WM-COMMAND|273|6|0" /> + <ButtonMapping KeyCode="Info" Description="INFO" Command="Window Message: CLASS|H2-WM-COMMAND|273|36|0" /> + <ButtonMapping KeyCode="Mute" Description="MUTE" Command="Window Message: CLASS|H2-WM-COMMAND|273|32|0" /> + <ButtonMapping KeyCode="Number0" Description="0" Command="Window Message: CLASS|H2-WM-COMMAND|273|10|0" /> + <ButtonMapping KeyCode="Number1" Description="1" Command="Window Message: CLASS|H2-WM-COMMAND|273|11|0" /> + <ButtonMapping KeyCode="Number2" Description="2" Command="Window Message: CLASS|H2-WM-COMMAND|273|12|0" /> + <ButtonMapping KeyCode="Number3" Description="3" Command="Window Message: CLASS|H2-WM-COMMAND|273|13|0" /> + <ButtonMapping KeyCode="Number4" Description="4" Command="Window Message: CLASS|H2-WM-COMMAND|273|14|0" /> + <ButtonMapping KeyCode="Number5" Description="5" Command="Window Message: CLASS|H2-WM-COMMAND|273|15|0" /> + <ButtonMapping KeyCode="Number6" Description="6" Command="Window Message: CLASS|H2-WM-COMMAND|273|16|0" /> + <ButtonMapping KeyCode="Number7" Description="7" Command="Window Message: CLASS|H2-WM-COMMAND|273|17|0" /> + <ButtonMapping KeyCode="Number8" Description="8" Command="Window Message: CLASS|H2-WM-COMMAND|273|18|0" /> + <ButtonMapping KeyCode="Number9" Description="9" Command="Window Message: CLASS|H2-WM-COMMAND|273|19|0" /> + <ButtonMapping KeyCode="Play" Description="PLAY" Command="Window Message: CLASS|H2-WM-COMMAND|273|21|0" /> + <ButtonMapping KeyCode="Pause" Description="PAUSE" Command="Window Message: CLASS|H2-WM-COMMAND|273|22|0" /> + <ButtonMapping KeyCode="Stop" Description="STOP" Command="Window Message: CLASS|H2-WM-COMMAND|273|27|0" /> + <ButtonMapping KeyCode="FastForward" Description="FFWD" Command="Window Message: CLASS|H2-WM-COMMAND|273|25|0" /> + <ButtonMapping KeyCode="Rewind" Description="REW" Command="Window Message: CLASS|H2-WM-COMMAND|273|26|0" /> + <ButtonMapping KeyCode="Record" Description="RECORD" Command="Window Message: CLASS|H2-WM-COMMAND|273|28|0" /> + <ButtonMapping KeyCode="NextChapter" Description="NEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|23|0" /> + <ButtonMapping KeyCode="PreviousChapter" Description="PREVIOUS" Command="Window Message: CLASS|H2-WM-COMMAND|273|24|0" /> + <ButtonMapping KeyCode="Power" Description="POWER" Command="Window Message: CLASS|H2-WM-COMMAND|273|38|0" /> + <ButtonMapping KeyCode="Power2" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Teletext" Description="TELETEXT" Command="Window Message: CLASS|H2-WM-COMMAND|273|52|0" /> + <ButtonMapping KeyCode="Red" Description="RED" Command="Window Message: CLASS|H2-WM-COMMAND|273|53|0" /> + <ButtonMapping KeyCode="Green" Description="GREEN" Command="Window Message: CLASS|H2-WM-COMMAND|273|54|0" /> + <ButtonMapping KeyCode="Yellow" Description="YELLOW" Command="Window Message: CLASS|H2-WM-COMMAND|273|55|0" /> + <ButtonMapping KeyCode="Blue" Description="BLUE" Command="Window Message: CLASS|H2-WM-COMMAND|273|56|0" /> + <ButtonMapping KeyCode="Clear" Description="CLEAR" Command="Window Message: CLASS|H2-WM-COMMAND|273|39|0" /> + <ButtonMapping KeyCode="Enter" Description="ENTER" Command="Window Message: CLASS|H2-WM-COMMAND|273|20|0" /> + <ButtonMapping KeyCode="_Hash" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="_Star" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Music" Description="GOTO-MUSIC" Command="Window Message: CLASS|H2-WM-COMMAND|273|46|0" /> + <ButtonMapping KeyCode="Pictures" Description="GOTO-PHOTOS" Command="Window Message: CLASS|H2-WM-COMMAND|273|47|0" /> + <ButtonMapping KeyCode="Videos" Description="GOTO-VIDEO" Command="Window Message: CLASS|H2-WM-COMMAND|273|50|0" /> + <ButtonMapping KeyCode="DVD" Description="GOTO-DVD" Command="Window Message: CLASS|H2-WM-COMMAND|273|48|0" /> + <ButtonMapping KeyCode="TV" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="Guide" Description="GUIDE" Command="Window Message: CLASS|H2-WM-COMMAND|273|34|0" /> + <ButtonMapping KeyCode="LiveTV" Description="GOTO-TV" Command="Window Message: CLASS|H2-WM-COMMAND|273|49|0" /> + <ButtonMapping KeyCode="PreviousChannel" Description="PREV-CH" Command="Window Message: CLASS|H2-WM-COMMAND|273|33|0" /> + <ButtonMapping KeyCode="_Radio" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + <ButtonMapping KeyCode="_Print" Description="" Command="Window Message: CLASS|H2-WM-COMMAND|273|4|0" /> + </ButtonMappings> +</AppProfile> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <ButtonMappings> - <ButtonMapping KeyCode="31743" Description="0" Command="Keys: {NUM0}" /> - <ButtonMapping KeyCode="31742" Description="1" Command="Keys: {NUM1}" /> - <ButtonMapping KeyCode="31741" Description="2" Command="Keys: {NUM2}" /> - <ButtonMapping KeyCode="31740" Description="3" Command="Keys: {NUM3}" /> - <ButtonMapping KeyCode="31739" Description="4" Command="Keys: {NUM4}" /> - <ButtonMapping KeyCode="31738" Description="5" Command="Keys: {NUM5}" /> - <ButtonMapping KeyCode="31737" Description="6" Command="Keys: {NUM6}" /> - <ButtonMapping KeyCode="31736" Description="7" Command="Keys: {NUM7}" /> - <ButtonMapping KeyCode="31735" Description="8" Command="Keys: {NUM8}" /> - <ButtonMapping KeyCode="31734" Description="9" Command="Keys: {NUM9}" /> - <ButtonMapping KeyCode="31713" Description="UP" Command="Keys: {UP}" /> - <ButtonMapping KeyCode="31712" Description="DOWN" Command="Keys: {DOWN}" /> - <ButtonMapping KeyCode="31711" Description="LEFT" Command="Keys: {LEFT}" /> - <ButtonMapping KeyCode="31710" Description="RIGHT" Command="Keys: {RIGHT}" /> - <ButtonMapping KeyCode="31709" Description="OK" Command="Keys: {ENTER}" /> - <ButtonMapping KeyCode="31722" Description="REW" Command="Keys: ^d" /> - <ButtonMapping KeyCode="31723" Description="FF" Command="Keys: ^f" /> - <ButtonMapping KeyCode="31721" Description="PLAY" Command="Keys: ^p" /> - <ButtonMapping KeyCode="31719" Description="PAUSE" Command="Keys: ^q" /> - <ButtonMapping KeyCode="31718" Description="STOP" Command="Keys: ^s" /> - <ButtonMapping KeyCode="31720" Description="RECORD" Command="Keys: ^k" /> - <ButtonMapping KeyCode="31716" Description="Track-" Command="Keys: ^{LEFT}" /> - <ButtonMapping KeyCode="31717" Description="Track+" Command="Keys: ^{RIGHT}" /> - <ButtonMapping KeyCode="31708" Description="Back" Command="Keys: {ESC}" /> - <ButtonMapping KeyCode="31728" Description="Info" Command="Keys: ^b" /> - <ButtonMapping KeyCode="31725" Description="Ch+" Command="Keys: {PGUP}" /> - <ButtonMapping KeyCode="31724" Description="Ch-" Command="Keys: {PGDN}" /> - <ButtonMapping KeyCode="31671" Description="Recorded TV" Command="Keys: {F8}" /> - <ButtonMapping KeyCode="31705" Description="Guide" Command="Keys: {F1}" /> - <ButtonMapping KeyCode="31706" Description="Live TV" Command="Keys: {F2}" /> - <ButtonMapping KeyCode="31730" Description="Last Channel" Command="Keys: ^w" /> - <ButtonMapping KeyCode="31714" Description="Videos" Command="Keys: {F3}" /> - <ButtonMapping KeyCode="31715" Description="Radio" Command="Keys: {F6}" /> - <ButtonMapping KeyCode="31732" Description="Audio" Command="Keys: {F4}" /> - <ButtonMapping KeyCode="31731" Description="Main Menu" Command="Keys: {HOME}" /> - </ButtonMappings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.xml (from rev 1439, trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml) =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.xml 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8"?> +<AppProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Name>PVRX2</Name> + <MatchType>Executable</MatchType> + <MatchParameters>pvrx2.exe</MatchParameters> + <ButtonMappings> + <ButtonMapping KeyCode="31743" Description="0" Command="Keys: {NUM0}" /> + <ButtonMapping KeyCode="31742" Description="1" Command="Keys: {NUM1}" /> + <ButtonMapping KeyCode="31741" Description="2" Command="Keys: {NUM2}" /> + <ButtonMapping KeyCode="31740" Description="3" Command="Keys: {NUM3}" /> + <ButtonMapping KeyCode="31739" Description="4" Command="Keys: {NUM4}" /> + <ButtonMapping KeyCode="31738" Description="5" Command="Keys: {NUM5}" /> + <ButtonMapping KeyCode="31737" Description="6" Command="Keys: {NUM6}" /> + <ButtonMapping KeyCode="31736" Description="7" Command="Keys: {NUM7}" /> + <ButtonMapping KeyCode="31735" Description="8" Command="Keys: {NUM8}" /> + <ButtonMapping KeyCode="31734" Description="9" Command="Keys: {NUM9}" /> + <ButtonMapping KeyCode="31713" Description="UP" Command="Keys: {UP}" /> + <ButtonMapping KeyCode="31712" Description="DOWN" Command="Keys: {DOWN}" /> + <ButtonMapping KeyCode="31711" Description="LEFT" Command="Keys: {LEFT}" /> + <ButtonMapping KeyCode="31710" Description="RIGHT" Command="Keys: {RIGHT}" /> + <ButtonMapping KeyCode="31709" Description="OK" Command="Keys: {ENTER}" /> + <ButtonMapping KeyCode="31722" Description="REW" Command="Keys: ^d" /> + <ButtonMapping KeyCode="31723" Description="FF" Command="Keys: ^f" /> + <ButtonMapping KeyCode="31721" Description="PLAY" Command="Keys: ^p" /> + <ButtonMapping KeyCode="31719" Description="PAUSE" Command="Keys: ^q" /> + <ButtonMapping KeyCode="31718" Description="STOP" Command="Keys: ^s" /> + <ButtonMapping KeyCode="31720" Description="RECORD" Command="Keys: ^k" /> + <ButtonMapping KeyCode="31716" Description="Track-" Command="Keys: ^{LEFT}" /> + <ButtonMapping KeyCode="31717" Description="Track+" Command="Keys: ^{RIGHT}" /> + <ButtonMapping KeyCode="31708" Description="Back" Command="Keys: {ESC}" /> + <ButtonMapping KeyCode="31728" Description="Info" Command="Keys: ^b" /> + <ButtonMapping KeyCode="31725" Description="Ch+" Command="Keys: {PGUP}" /> + <ButtonMapping KeyCode="31724" Description="Ch-" Command="Keys: {PGDN}" /> + <ButtonMapping KeyCode="31671" Description="Recorded TV" Command="Keys: {F8}" /> + <ButtonMapping KeyCode="31705" Description="Guide" Command="Keys: {F1}" /> + <ButtonMapping KeyCode="31706" Description="Live TV" Command="Keys: {F2}" /> + <ButtonMapping KeyCode="31730" Description="Last Channel" Command="Keys: ^w" /> + <ButtonMapping KeyCode="31714" Description="Videos" Command="Keys: {F3}" /> + <ButtonMapping KeyCode="31715" Description="Radio" Command="Keys: {F6}" /> + <ButtonMapping KeyCode="31732" Description="Audio" Command="Keys: {F4}" /> + <ButtonMapping KeyCode="31731" Description="Main Menu" Command="Keys: {HOME}" /> + </ButtonMappings> +</AppProfile> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -77,7 +77,7 @@ comboBoxCommands.Items.Add(Common.UITextSmsKB); comboBoxCommands.Items.Add(Common.UITextBeep); comboBoxCommands.Items.Add(Common.UITextSound); - comboBoxCommands.Items.Add(Common.UITextDisplay); + comboBoxCommands.Items.Add(Common.UITextDisplayMode); comboBoxCommands.Items.Add(Common.UITextStandby); comboBoxCommands.Items.Add(Common.UITextHibernate); comboBoxCommands.Items.Add(Common.UITextReboot); @@ -237,11 +237,11 @@ if (openFileDialog.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixSound + openFileDialog.FileName; } - else if (selected.Equals(Common.UITextDisplay, StringComparison.OrdinalIgnoreCase)) + else if (selected.Equals(Common.UITextDisplayMode, StringComparison.OrdinalIgnoreCase)) { DisplayModeCommand displayModeCommand = new DisplayModeCommand(); if (displayModeCommand.ShowDialog(this) == DialogResult.OK) - newCommand = Common.CmdPrefixDisplay + displayModeCommand.CommandString; + newCommand = Common.CmdPrefixDisplayMode + displayModeCommand.CommandString; } else if (selected.Equals(Common.UITextStandby, StringComparison.OrdinalIgnoreCase)) { @@ -542,13 +542,13 @@ if (openFileDialog.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixSound + openFileDialog.FileName; } - else if (selected.StartsWith(Common.CmdPrefixDisplay, StringComparison.OrdinalIgnoreCase)) + else if (selected.StartsWith(Common.CmdPrefixDisplayMode, StringComparison.OrdinalIgnoreCase)) { - string[] commands = Common.SplitDisplayModeCommand(selected.Substring(Common.CmdPrefixDisplay.Length)); + string[] commands = Common.SplitDisplayModeCommand(selected.Substring(Common.CmdPrefixDisplayMode.Length)); DisplayModeCommand displayModeCommand = new DisplayModeCommand(commands); if (displayModeCommand.ShowDialog(this) == DialogResult.OK) - newCommand = Common.CmdPrefixDisplay + displayModeCommand.CommandString; + newCommand = Common.CmdPrefixDisplayMode + displayModeCommand.CommandString; } else if (selected.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -106,6 +106,8 @@ List<Menus> _menuStack; + Win32.EnumWindowsProc _ewp; + #endregion Variables /// <summary> @@ -115,6 +117,8 @@ { InitializeComponent(); + _ewp = new Win32.EnumWindowsProc(AddTask); + CreateMainImageList(); _launch = new ListViewItem(UITextLaunch, 0); @@ -753,42 +757,53 @@ if (index >= listViewMenu.Items.Count) return; - ListViewItem selectedItem = listViewMenu.Items[index]; - - if (selectedItem.Tag == null) + try { - return; - } - else if (selectedItem.Tag is Menus) - { - SwitchMenu((Menus)selectedItem.Tag); - } - else if (selectedItem.Tag is IntPtr) - { - IntPtr handle = (IntPtr)selectedItem.Tag; + ListViewItem selectedItem = listViewMenu.Items[index]; - switch (GetCurrentMenu()) + if (selectedItem.Tag == null) { - case Menus.Tasks: TaskSwap(handle); break; - case Menus.Windows: TaskSwap(handle); break; - case Menus.WindowActivate: TaskSwap(handle); break; - case Menus.WindowClose: Close(handle); break; - case Menus.WindowMaximize: Maximize(handle); break; - case Menus.WindowMinimize: Minimize(handle); break; + return; } + else if (selectedItem.Tag is Menus) + { + SwitchMenu((Menus)selectedItem.Tag); + } + else if (selectedItem.Tag is IntPtr) + { + IntPtr handle = (IntPtr)selectedItem.Tag; + + switch (GetCurrentMenu()) + { + case Menus.Tasks: TaskSwap(handle); break; + case Menus.Windows: TaskSwap(handle); break; + case Menus.WindowActivate: TaskSwap(handle); break; + case Menus.WindowClose: Close(handle); break; + case Menus.WindowMaximize: Maximize(handle); break; + case Menus.WindowMinimize: Minimize(handle); break; + } + } + else if (selectedItem.Tag is string) + { + string tag = (string)selectedItem.Tag; + + if (tag.StartsWith(TagLaunch, StringComparison.OrdinalIgnoreCase)) + Launch(tag.Substring(TagLaunch.Length)); + else if (tag.StartsWith(TagMacro, StringComparison.OrdinalIgnoreCase)) + RunMacro(tag.Substring(TagMacro.Length)); + else if (tag.StartsWith(TagCommand, StringComparison.OrdinalIgnoreCase)) + Command(tag.Substring(TagCommand.Length)); + else if (tag.StartsWith(TagEject, StringComparison.OrdinalIgnoreCase)) + Eject(tag.Substring(TagEject.Length)); + } + else + { + throw new InvalidOperationException("Unexpected selectedItem Tag data type"); + } } - else if (selectedItem.Tag is string) + catch (Exception ex) { - string tag = (string)selectedItem.Tag; - - if (tag.StartsWith(TagLaunch, StringComparison.OrdinalIgnoreCase)) - Launch(tag.Substring(TagLaunch.Length)); - else if (tag.StartsWith(TagMacro, StringComparison.OrdinalIgnoreCase)) - RunMacro(tag.Substring(TagMacro.Length)); - else if (tag.StartsWith(TagCommand, StringComparison.OrdinalIgnoreCase)) - Command(tag.Substring(TagCommand.Length)); - else if (tag.StartsWith(TagEject, StringComparison.OrdinalIgnoreCase)) - Eject(tag.Substring(TagEject.Length)); + IrssLog.Error(ex); } } @@ -849,9 +864,7 @@ void PopulateTaskList() { - Win32.EnumWindowsProc ewp = new Win32.EnumWindowsProc(AddTask); - - Win32.EnumerateWindows(ewp, IntPtr.Zero); + Win32.EnumerateWindows(_ewp, IntPtr.Zero); } bool AddTask(IntPtr hWnd, IntPtr lParam) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -134,6 +134,18 @@ _config = new Configuration(); } + foreach (ProgramSettings progSettings in _config.Programs) + { + AppProfile profile = new AppProfile(); + + profile.Name = progSettings.Name; + profile.MatchType = AppProfile.DetectionMethod.Executable; + profile.MatchParameters = progSettings.FileName; + profile.ButtonMappings.AddRange(progSettings.ButtonMappings); + + AppProfile.Save(profile, "C:\\" + profile.Name + ".xml"); + } + // Setup notify icon ... _notifyIcon = new NotifyIcon(); _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2008-03-09 13:19:30 UTC (rev 1440) @@ -68,6 +68,7 @@ <ItemGroup> <Compile Include="ButtonMapping.cs" /> <Compile Include="Configuration.cs" /> + <Compile Include="AppProfile.cs" /> <Compile Include="Forms\ButtonMappingForm.cs"> <SubType>Form</SubType> </Compile> Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -122,7 +122,8 @@ public const string CmdPrefixEject = "Eject: "; public const string CmdPrefixSound = "Sound: "; public const string CmdPrefixBeep = "Beep: "; - public const string CmdPrefixDisplay = "Display Mode: "; + public const string CmdPrefixDisplayMode = "Display Mode: "; + public const string CmdPrefixDisplayPower = "Display Power: "; public const string CmdPrefixTranslator = "Show Translator OSD"; public const string CmdPrefixVirtualKB = "Show Virtual Keyboard"; @@ -173,7 +174,8 @@ public const string UITextEject = "Eject CD"; public const string UITextSound = "Play Sound"; public const string UITextBeep = "Beep"; - public const string UITextDisplay = "Display Mode"; + public const string UITextDisplayMode = "Display Mode"; + public const string UITextDisplayPower = "Display Power"; public const string UITextTranslator = "Show Translator OSD"; public const string UITextVirtualKB = "Show Virtual Keyboard"; @@ -836,6 +838,22 @@ } /// <summary> + /// Processes the display power command. + /// </summary> + /// <param name="command">The command.</param> + public static void ProcessDisplayPowerCommand(string command) + { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + + int powerState = -1; + if (int.TryParse(command, out powerState)) + Display.SetPowerState(powerState); + else + throw new Exceptions.CommandStructureException(String.Format("Display Power Command data is not a valid integer: {0}", command)); + } + + /// <summary> /// Given a split Close Program Command this method will attempt to close a program by command structure supplied. /// </summary> /// <param name="commands">An array of arguments for the method (the output of SplitCloseProgramCommand).</param> Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs 2008-03-08 14:19:16 UTC (rev 1439) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -23,6 +23,13 @@ const int DISP_CHANGE_RESTART = 1; const int DISP_CHANGE_FAILED = -1; + const int SC_MONITORPOWER = 0xF170; + const int WM_SYSCOMMAND = 0x0112; + + const int MONITOR_ON = -1; + const int MONITOR_STANBY = 1; + const int MONITOR_OFF = 2; + #endregion Constants #region Interop @@ -85,6 +92,10 @@ #endregion Structures + /// <summary> + /// Gets the device mode. + /// </summary> + /// <returns>Current device mode.</returns> static DEVMODE GetDevMode() { DEVMODE devMode = new DEVMODE(); @@ -178,6 +189,19 @@ throw new InvalidOperationException(String.Format("Setting display mode failed ({0})", set)); } + /// <summary> + /// Sets the display power state. + /// </summary> + /// <param name="powerState">New display power state.</param> + public static void SetPowerState(int powerState) + { + IntPtr desktop = Win32.GetDesktopWindowHandle(); + if (desktop == IntPtr.Zero) + throw new InvalidOperationException("Failed to get handle to dekstop"); + + Win32.SendWindowsMessage(desktop, WM_SYSCOMMAND, SC_MONITORPOWER, powerState); + } + } } Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.Designer.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,111 @@ +namespace IrssUtils.Forms +{ + + partial class DisplayPowerCommand + { + + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.labelSetPowerState = new System.Windows.Forms.Label(); + this.comboBoxState = new System.Windows.Forms.ComboBox(); + 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(80, 64); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 10; + 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(8, 64); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 9; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // labelSetPowerState + // + this.labelSetPowerState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelSetPowerState.Location = new System.Drawing.Point(8, 8); + this.labelSetPowerState.Name = "labelSetPowerState"; + this.labelSetPowerState.Size = new System.Drawing.Size(136, 24); + this.labelSetPowerState.TabIndex = 11; + this.labelSetPowerState.Text = "Set display power state:"; + // + // comboBoxState + // + this.comboBoxState.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxState.FormattingEnabled = true; + this.comboBoxState.Location = new System.Drawing.Point(8, 32); + this.comboBoxState.Name = "comboBoxState"; + this.comboBoxState.Size = new System.Drawing.Size(136, 21); + this.comboBoxState.TabIndex = 12; + // + // DisplayPowerCommand + // + 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(152, 96); + this.Controls.Add(this.comboBoxState); + this.Controls.Add(this.labelSetPowerState); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(160, 116); + this.Name = "DisplayPowerCommand"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Display Power"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelSetPowerState; + private System.Windows.Forms.ComboBox comboBoxState; + } + +} Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.cs 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace IrssUtils.Forms +{ + + /// <summary> + /// Display Power Command form. + /// </summary> + public partial class DisplayPowerCommand : Form + { + + #region Properties + + /// <summary> + /// Gets the command string. + /// </summary> + /// <value>The command string.</value> + public string CommandString + { + get + { + return comboBoxState.SelectedItem as string; + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="DisplayPowerCommand"/> class. + /// </summary> + public DisplayPowerCommand() + { + InitializeComponent(); + + comboBoxState.Items.Add("On"); + comboBoxState.Items.Add("Off"); + comboBoxState.Items.Add("Standby"); + + comboBoxState.SelectedIndex = 0; + } + + /// <summary> + /// Initializes a new instance of the <see cref="DisplayPowerCommand"/> class. + /// </summary> + /// <param name="command">The command.</param> + public DisplayPowerCommand(string command) : this() + { + comboBoxState.SelectedItem = command; + } + + #endregion + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.resx =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.resx (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayPowerCommand.resx 2008-03-09 13:19:30 UTC (rev 1440) @@ -0,0 +1,120 @@ +<?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 gener... [truncated message content] |
From: <an...@us...> - 2008-03-11 13:02:32
|
Revision: 1445 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1445&view=rev Author: and-81 Date: 2008-03-11 06:02:30 -0700 (Tue, 11 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/Technotrend.xml trunk/plugins/ShortcutFileSupport/LnkPlayer.cs Added Paths: ----------- trunk/plugins/TechnotrendRemote/ trunk/plugins/TechnotrendRemote/AssemblyInfo.cs trunk/plugins/TechnotrendRemote/Technotrend Plugin.csproj trunk/plugins/TechnotrendRemote/TechnotrendPlugin.cs trunk/plugins/TechnotrendRemote/TechnotrendPlugin.xml Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-11 03:29:59 UTC (rev 1444) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-11 13:02:30 UTC (rev 1445) @@ -17,38 +17,6 @@ public class TechnotrendReceiver : PluginBase, IRemoteReceiver { - #region Debug - - [STAThread] - static void Main() - { - try - { - TechnotrendReceiver c = new TechnotrendReceiver(); - - //c.Configure(null); - - //c.RemoteCallback += new RemoteHandler(xRemote); - - c.Start(); - - Console.ReadKey(); - //System.Windows.Forms.Application.Run(); - - c.Stop(); - c = null; - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - - Console.ReadKey(); - } - - #endregion Debug - - #region Enumerations /// <summary> @@ -192,7 +160,6 @@ RemoteHandler _remoteButtonHandler; - int _lastTrigger = -1; int _lastCode = -1; DateTime _lastCodeTime = DateTime.Now; @@ -294,22 +261,23 @@ IntPtr handle; TYPE_RET_VAL error; + int context = 1; + for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_DSS; cat++) { - if (bdaapiEnumerate(cat) > 0) + uint enumerate = bdaapiEnumerate(cat); + + for (uint index = 0; index < enumerate; index++) { - handle = bdaapiOpen(cat, 0); + handle = bdaapiOpen(cat, index); + if ((handle != IntPtr.Zero) && (handle.ToInt32() != -1)) { - error = bdaapiOpenIR(handle, _callbackPtr, 0); + error = bdaapiOpenIR(handle, _callbackPtr, context++); if (error == TYPE_RET_VAL.RET_SUCCESS) - { _handles.Add(handle); - } else - { bdaapiClose(handle); - } } } } @@ -367,27 +335,31 @@ { try { - int code = ((int)buffer[0]) & 0x00FF; - int trigger = ((int)buffer[0]) & 0x0800; + int code = ((int)buffer[0]) & 0x00FF; DateTime now = DateTime.Now; TimeSpan timeSpan = now - _lastCodeTime; - if (code != _lastCode || trigger != _lastTrigger || timeSpan.Milliseconds >= 250) + if (code != _lastCode || timeSpan.Milliseconds >= 250) { if (_remoteButtonHandler != null) - _remoteButtonHandler("Technotrend", code.ToString()); + _remoteButtonHandler(this.Name, code.ToString()); _lastCodeTime = now; } - _lastCode = code; - _lastTrigger = trigger; + _lastCode = code; } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else catch { - //MessageBox.Show(ex.ToString()); } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-03-11 03:29:59 UTC (rev 1444) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-03-11 13:02:30 UTC (rev 1445) @@ -252,6 +252,9 @@ Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection + ProjectSection(SolutionItems) = preProject + IR Server Suite.nsi = IR Server Suite.nsi + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Direct Input Receiver", "IR Server Plugins\Direct Input Receiver\Direct Input Receiver.csproj", "{732CDF64-D047-4D3C-91DA-E2FF27D84179}" ProjectSection(WebsiteProperties) = preProject Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/Technotrend.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/Technotrend.xml 2008-03-11 03:29:59 UTC (rev 1444) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/Technotrend.xml 2008-03-11 13:02:30 UTC (rev 1445) @@ -36,5 +36,7 @@ <RemoteTable RawCode="87" AbstractButton="Blue" /> <RemoteTable RawCode="90" AbstractButton="TV" /> <RemoteTable RawCode="98" AbstractButton="Guide" /> + <RemoteTable RawCode="97" AbstractButton="Menu" /> + <RemoteTable RawCode="103" AbstractButton="Setup" /> <RemoteTable RawCode="66" AbstractButton="Refresh" /> </DocumentElement> \ No newline at end of file Modified: trunk/plugins/ShortcutFileSupport/LnkPlayer.cs =================================================================== --- trunk/plugins/ShortcutFileSupport/LnkPlayer.cs 2008-03-11 03:29:59 UTC (rev 1444) +++ trunk/plugins/ShortcutFileSupport/LnkPlayer.cs 2008-03-11 13:02:30 UTC (rev 1445) @@ -38,6 +38,8 @@ { ShellLink link = new ShellLink(strFile); + Log.Info("Link Target: {0}", link.Target); + if (Directory.Exists(link.Target)) GotoFolder(link.Target); else if (File.Exists(link.Target)) Added: trunk/plugins/TechnotrendRemote/AssemblyInfo.cs =================================================================== --- trunk/plugins/TechnotrendRemote/AssemblyInfo.cs (rev 0) +++ trunk/plugins/TechnotrendRemote/AssemblyInfo.cs 2008-03-11 13:02:30 UTC (rev 1445) @@ -0,0 +1,67 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("Technotrend Plugin")] +[assembly: AssemblyDescription("Supports Technotrend remotes")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.4.2")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<setupForm>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] +[assembly: ComVisibleAttribute(false)] +[assembly: AssemblyFileVersionAttribute("1.0.4.2")] + +[assembly: CLSCompliant(true)] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/TechnotrendRemote/Technotrend Plugin.csproj =================================================================== --- trunk/plugins/TechnotrendRemote/Technotrend Plugin.csproj (rev 0) +++ trunk/plugins/TechnotrendRemote/Technotrend Plugin.csproj 2008-03-11 13:02:30 UTC (rev 1445) @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>TechnotrendPlugin</AssemblyName> + <StartupObject> + </StartupObject> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="TechnotrendPlugin.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="RemotePlugins, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\Technotrend Plugin\Release\"</PostBuildEvent> + </PropertyGroup> + <ItemGroup> + <Content Include="TechnotrendPlugin.xml"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + </ItemGroup> +</Project> \ No newline at end of file Added: trunk/plugins/TechnotrendRemote/TechnotrendPlugin.cs =================================================================== --- trunk/plugins/TechnotrendRemote/TechnotrendPlugin.cs (rev 0) +++ trunk/plugins/TechnotrendRemote/TechnotrendPlugin.cs 2008-03-11 13:02:30 UTC (rev 1445) @@ -0,0 +1,311 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; + +using MediaPortal.GUI.Library; +using MediaPortal.InputDevices; + +namespace MediaPortal.Plugins +{ + + /// <summary> + /// Technotrend remote plugin + /// </summary> + public class TechnotrendPlugin : IPlugin, ISetupForm + { + + #region Enumerations + + /// <summary> + /// Device Category. + /// </summary> + enum DEVICE_CAT + { + /// <summary> + /// Not set. + /// </summary> + UNKNOWN = 0, + /// <summary> + /// Budget 2. + /// </summary> + BUDGET_2, + /// <summary> + /// Budget 3 aka TT-budget T-3000. + /// </summary> + BUDGET_3, + /// <summary> + /// USB 2.0 + /// </summary> + USB_2, + /// <summary> + /// USB 2.0 Pinnacle. + /// </summary> + USB_2_PINNACLE, + /// <summary> + /// USB 2.0 DSS. + /// </summary> + USB_2_DSS, + } + + /// <summary> + /// Return Value. + /// </summary> + enum TYPE_RET_VAL + { + /// <summary> + /// 0 operation finished successful. + /// </summary> + RET_SUCCESS = 0, + /// <summary> + /// 1 operation is not implemented for the opened handle. + /// </summary> + RET_NOT_IMPL, + /// <summary> + /// 2 operation is not supported for the opened handle. + /// </summary> + RET_NOT_SUPPORTED, + /// <summary> + /// 3 the given HANDLE seems not to be correct. + /// </summary> + RET_ERROR_HANDLE, + /// <summary> + /// 4 the internal IOCTL subsystem has no device handle. + /// </summary> + RET_IOCTL_NO_DEV_HANDLE, + /// <summary> + /// 5 the internal IOCTL failed. + /// </summary> + RET_IOCTL_FAILED, + /// <summary> + /// 6 the infrared interface is already initialised. + /// </summary> + RET_IR_ALREADY_OPENED, + /// <summary> + /// 7 the infrared interface is not initialised. + /// </summary> + RET_IR_NOT_OPENED, + /// <summary> + /// 8 length exceeds maximum in EEPROM-Userspace operation. + /// </summary> + RET_TO_MANY_BYTES, + /// <summary> + /// 9 common interface hardware error. + /// </summary> + RET_CI_ERROR_HARDWARE, + /// <summary> + /// a common interface already opened. + /// </summary> + RET_CI_ALREADY_OPENED, + /// <summary> + /// b operation finished with timeout. + /// </summary> + RET_TIMEOUT, + /// <summary> + /// c read psi failed. + /// </summary> + RET_READ_PSI_FAILED, + /// <summary> + /// d not set. + /// </summary> + RET_NOT_SET, + /// <summary> + /// e operation finished with general error. + /// </summary> + RET_ERROR, + /// <summary> + /// f operation finished with ilegal pointer. + /// </summary> + RET_ERROR_POINTER, + } + + #endregion Enumerations + + #region Delegates + + /// <summary> + /// Called by the Technotrend api dll to signal a remote button has been received. + /// </summary> + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + unsafe delegate void CallbackDef(int context, uint* buffer); + + #endregion Delegates + + #region Interop + + [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiEnumerate")] + static extern UInt32 bdaapiEnumerate(DEVICE_CAT deviceType); + + [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiOpen")] + static extern IntPtr bdaapiOpen(DEVICE_CAT deviceType, uint deviceId); + + [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiClose")] + static extern void bdaapiClose(IntPtr handle); + + [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiOpenIR")] + static extern TYPE_RET_VAL bdaapiOpenIR(IntPtr handle, IntPtr callback, int context); + + [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiCloseIR")] + static extern TYPE_RET_VAL bdaapiCloseIR(IntPtr handle); + + #endregion Interop + + #region Variables + + InputHandler _inputHandler; + + List<IntPtr> _handles; + CallbackDef _callback; + IntPtr _callbackPtr; + + int _lastCode = -1; + DateTime _lastCodeTime = DateTime.Now; + + #endregion Variables + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="TechnotrendPlugin"/> class. + /// </summary> + public TechnotrendPlugin() + { + _handles = new List<IntPtr>(); + + unsafe + { + _callback = new CallbackDef(OnIRCode); + _callbackPtr = Marshal.GetFunctionPointerForDelegate(_callback); + } + } + + #endregion Constructor + + #region IPlugin Members + + /// <summary> + /// Starts this instance. + /// </summary> + public void Start() + { + Log.Info("Technotrend Plugin: Start"); + + _inputHandler = new InputHandler("TechnotrendPlugin"); + + IntPtr handle; + TYPE_RET_VAL error; + + int context = 1; + + for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_DSS; cat++) + { + uint enumerate = bdaapiEnumerate(cat); + + for (uint index = 0; index < enumerate; index++) + { + handle = bdaapiOpen(cat, index); + + if ((handle != IntPtr.Zero) && (handle.ToInt32() != -1)) + { + error = bdaapiOpenIR(handle, _callbackPtr, context++); + if (error == TYPE_RET_VAL.RET_SUCCESS) + _handles.Add(handle); + else + bdaapiClose(handle); + } + } + } + + if (_handles.Count == 0) + Log.Warn("No Technotrend IR devices found"); + } + + /// <summary> + /// Stops this instance. + /// </summary> + public void Stop() + { + Log.Info("Technotrend Plugin: Stop"); + + if (_handles.Count == 0) + return; + + foreach (IntPtr handle in _handles) + { + bdaapiCloseIR(handle); + bdaapiClose(handle); + } + + _handles.Clear(); + } + + #endregion IPlugin Members + + #region ISetupForm Members + + public string Author() { return "and-81, with code by Alexander Plas"; } + public bool CanEnable() { return true; } + public bool DefaultEnabled() { return true; } + public string Description() { return "Supports Technotrend remotes"; } + public int GetWindowId() { return 0; } + public bool HasSetup() { return true; } + public string PluginName() { return "Technotrend Plugin"; } + + public void ShowPlugin() + { + InputMappingForm inputMappingForm = new InputMappingForm("Technotrend Remote"); + inputMappingForm.ShowDialog(); + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; + return false; + } + + #endregion ISetupForm Members + + #region Implementation + + /// <summary> + /// Called when an IR code is received. + /// </summary> + /// <param name="context">The context.</param> + /// <param name="buffer">The code.</param> + unsafe void OnIRCode(int context, uint* buffer) + { + try + { + int code = ((int)buffer[0]) & 0x00FF; + + DateTime now = DateTime.Now; + TimeSpan timeSpan = now - _lastCodeTime; + + if (code != _lastCode || timeSpan.Milliseconds >= 250) + { + _inputHandler.MapAction(code); + + _lastCodeTime = now; + } + + _lastCode = code; + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + } + + + #endregion Implementation + + } + +} Added: trunk/plugins/TechnotrendRemote/TechnotrendPlugin.xml =================================================================== --- trunk/plugins/TechnotrendRemote/TechnotrendPlugin.xml (rev 0) +++ trunk/plugins/TechnotrendRemote/TechnotrendPlugin.xml 2008-03-11 13:02:30 UTC (rev 1445) @@ -0,0 +1,512 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<mappings version="3"> + <remote family="Technotrend Remote"> + <button name="Home" code="2059"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="0" sound="back.wav" focus="True" /> + </button> + <button name="Power" code="2061"> + <action layer="0" condition="*" conproperty="-1" command="POWER" cmdproperty="EXIT" sound="back.wav" /> + </button> + <button name="TV" code="2028"> + <action layer="0" condition="WINDOW" conproperty="7701" command="WINDOW" cmdproperty="602" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="1" sound="click.wav" /> + </button> + <button name="Videos" code="2024"> + <action layer="0" condition="WINDOW" conproperty="6" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2005" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="6" sound="click.wav" /> + </button> + <button name="Music" code="2025"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="501" sound="click.wav" /> + </button> + <button name="Pictures" code="2026"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="2" sound="click.wav" /> + </button> + <button name="Guide" code="2027"> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="10" sound="back.wav" /> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="600" sound="click.wav" /> + </button> + <button name="Radio" code="2012"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="30" sound="click.wav" /> + </button> + <button name="Cursor Up" code="2020"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="3" sound="cursor.wav" /> + </button> + <button name="Cursor Down" code="2021"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="4" sound="cursor.wav" /> + </button> + <button name="Cursor Left" code="2022"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="1" sound="cursor.wav" /> + </button> + <button name="Cursor Right" code="2023"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="28" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="2" sound="cursor.wav" /> + </button> + <button name="OK" code="2037"> + <action layer="0" condition="WINDOW" conproperty="11" command="ACTION" cmdproperty="47" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdproperty="10" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="7" sound="click.wav" /> + </button> + <button name="Back/Exit" code="2031"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="10" sound="back.wav" /> + </button> + <button name="Menu/i" code="2013"> + <action layer="0" condition="FULLSCREEN" conproperty="TRUE" command="ACTION" cmdproperty="24" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="106" sound="click.wav" /> + </button> + <button name="Volume +" code="2016"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="103" sound="cursor.wav" /> + </button> + <button name="Volume -" code="2017"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="102" sound="cursor.wav" /> + </button> + <button name="Mute" code="2015"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="9982" sound="click.wav" /> + </button> + <button name="Previous Channel" code="2018"> + <action layer="0" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="111" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="111" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="96" sound="back.wav" /> + <action layer="0" condition="PLAYER" conproperty="DVD" command="ACTION" cmdproperty="90" sound="back.wav" /> + <action layer="0" condition="FULLSCREEN" conproperty="TRUE" command="ACTION" cmdproperty="76" sound="back.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="9" sound="back.wav" /> + </button> + <button name="Channel +" code="2032"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="5" sound="cursor.wav" /> + </button> + <button name="Channel -" code="2033"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="6" sound="cursor.wav" /> + </button> + <button name="Record" code="2055"> + <action layer="0" condition="WINDOW" conproperty="501" command="ACTION" cmdproperty="113" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="89" sound="click.wav" /> + </button> + <button name="Stop" code="2054"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="13" sound="click.wav" /> + </button> + <button name="Play" code="2053"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="68" sound="click.wav" /> + </button> + <button name="Pause" code="2048"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="12" sound="click.wav" /> + </button> + <button name="Fast Forward" code="2052"> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="86" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="16" sound="cursor.wav" /> + </button> + <button name="Rewind" code="2050"> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="87" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="17" sound="cursor.wav" /> + </button> + <button name="Skip Forward" code="2030"> + <action layer="0" condition="PLAYER" conproperty="DVD" command="ACTION" cmdproperty="91" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="5" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="28" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2005" command="ACTION" cmdproperty="91" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="14" sound="cursor.wav" /> + </button> + <button name="Skip Previous" code="2036"> + <action layer="0" condition="PLAYER" conproperty="DVD" command="ACTION" cmdproperty="92" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="6" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2005" command="ACTION" cmdproperty="92" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="15" sound="cursor.wav" /> + </button> + <button name="1" code="2001"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="37" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="49" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="2" code="2002"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="38" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="50" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="3" code="2003"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="39" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="51" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="4" code="2004"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="40" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="52" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="5" code="2005"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="41" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="53" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="6" code="2006"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="42" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="54" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="7" code="2007"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="43" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="55" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="8" code="2008"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="44" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="56" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="9" code="2009"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="45" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="57" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="0" code="2000"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="25" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="603" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="605" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="606" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="501" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="601" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="759" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="6" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdproperty="48" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="11" command="ACTION" cmdproperty="48" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="88" sound="back.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="48" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="*" code="2010"> + <action layer="0" condition="WINDOW" conproperty="1" command="WINDOW" cmdproperty="7700" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="WINDOW" cmdproperty="7701" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="WINDOW" cmdproperty="7701" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7701" command="WINDOW" cmdproperty="7700" sound="click.wav" /> + <action layer="0" condition="PLAYER" conproperty="TV" command="WINDOW" cmdproperty="7701" sound="click.wav" /> + </button> + <button name="#" code="2014"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="19" sound="click.wav" /> + </button> + <button name="Red" code="2011"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9975" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9975" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="18" sound="click.wav" /> + </button> + <button name="Green" code="2046"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9976" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9976" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="26" sound="click.wav" /> + </button> + <button name="Yellow" code="2056"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9977" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9977" sound="click.wav" /> + <action layer="0" condition="FULLSCREEN" conproperty="true" command="ACTION" cmdproperty="119" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="11" sound="click.wav" /> + </button> + <button name="Blue" code="2041"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9978" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9978" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="122" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="19" sound="click.wav" /> + </button> + <button name="RESTOREMP" code="100000"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="123" sound="cursor.wav" /> + </button> + </remote> + <remote family="Hauppauge 34-button remote"> + <button name="Power" code="1061"> + <action layer="0" condition="*" conproperty="-1" command="POWER" cmdproperty="EXIT" sound="back.wav" /> + </button> + <button name="Home" code="1059"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="0" sound="back.wav" /> + </button> + <button name="1" code="1001"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="37" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="49" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="2" code="1002"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="38" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="50" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="3" code="1003"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="39" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="51" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="4" code="1004"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="40" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="52" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="5" code="1005"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="41" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="53" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="6" code="1006"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="42" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="54" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="7" code="1007"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="43" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="55" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="8" code="1008"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="44" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="56" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="9" code="1009"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="45" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="57" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="0" code="1000"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="25" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="603" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="605" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="606" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="501" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="601" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="759" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="6" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdproperty="48" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="11" command="ACTION" cmdproperty="48" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="88" sound="back.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="48" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="Back/Exit" code="1031"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="10" sound="back.wav" /> + </button> + <button name="Menu/i" code="1013"> + <action layer="0" condition="FULLSCREEN" conproperty="TRUE" command="ACTION" cmdproperty="24" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="106" sound="click.wav" /> + </button> + <button name="Red" code="1011"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9975" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9975" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="18" sound="click.wav" /> + </button> + <button name="Green" code="1046"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9976" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9976" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="26" sound="click.wav" /> + </button> + <button name="Yellow" code="1056"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9977" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9977" sound="click.wav" /> + <action layer="0" condition="FULLSCREEN" conproperty="true" command="ACTION" cmdproperty="119" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="11" sound="click.wav" /> + </button> + <button name="Blue" code="1041"> + <action layer="0" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9978" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9978" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="122" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="19" sound="click.wav" /> + </button> + <button name="Channel +" code="1032"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="3" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="5" sound="cursor.wav" /> + </button> + <button name="Channel -" code="1033"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="4" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="6" sound="cursor.wav" /> + </button> + <button name="Volume -" code="1017"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="1" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="102" sound="cursor.wav" /> + </button> + <button name="Volume +" code="1016"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="28" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="2" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="103" sound="cursor.wav" /> + </button> + <button name="OK" code="1037"> + <action layer="0" condition="WINDOW" conproperty="11" command="ACTION" cmdproperty="47" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdproperty="10" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="7" sound="click.wav" /> + </button> + <button name="Mute" code="1015"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="9982" sound="click.wav" /> + </button> + <button name="Func" code="1012"> + <action layer="0" condition="*" conproperty="-1" command="TOGGLE" cmdproperty="-1" sound="click.wav" /> + </button> + <button name="Fullscreen" code="1060"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="18" sound="click.wav" /> + </button> + <button name="Fast Forward" code="1052"> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="86" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="16" sound="cursor.wav" /> + </button> + <button name="Rewind" code="1050"> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="87" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="17" sound="cursor.wav" /> + </button> + <button name="Record" code="1055"> + <action layer="0" condition="WINDOW" conproperty="501" command="ACTION" cmdproperty="113" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="89" sound="click.wav" /> + </button> + <button name="Stop" code="1054"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="13" sound="click.wav" /> + </button> + <button name="Pause" code="1048"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="12" sound="click.wav" /> + </button> + <button name="Play" code="1053"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="68" sound="click.wav" /> + </button> + <button name="Skip Previous" code="1036"> + <action layer="0" condition="PLAYER" conproperty="DVD" command="ACTION" cmdproperty="92" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="6" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="15" sound="cursor.wav" /> + </button> + <button name="Skip Forward" code="1030"> + <action layer="0" condition="PLAYER" conproperty="DVD" command="ACTION" cmdproperty="91" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="600" command="ACTION" cmdproperty="5" sound="cursor.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="28" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="14" sound="cursor.wav" /> + </button> + <button name="RESTOREMP" code="100000"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="123" sound="cursor.wav" /> + </button> + </remote> + <remote family="Hauppauge 21-button remote"> + <button name="TV" code="15"> + <action layer="0" condition="WINDOW" conproperty="7701" command="WINDOW" cmdproperty="602" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="18" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="1" sound="click.wav" /> + </button> + <button name="Radio" code="12"> + <action layer="0" condition="*" conproperty="-1" command="WINDOW" cmdproperty="30" sound="click.wav" /> + </button> + <button name="Channel +" code="32"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="click.wav" /> + <action layer="2" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9979" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="31" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="95" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="3" sound="click.wav" /> + </button> + <button name="Channel -" code="33"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="click.wav" /> + <action layer="2" condition="WINDOW" conproperty="7701" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="7700" command="ACTION" cmdproperty="9980" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="30" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="1" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="2" condition="WINDOW" conproperty="602" command="ACTION" cmdproperty="94" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="4" sound="click.wav" /> + </button> + <button name="Volume -" code="17"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="29" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="1" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="102" sound="cursor.wav" /> + </button> + <button name="Volume +" code="16"> + <action layer="1" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="28" sound="click.wav" /> + <action layer="1" condition="*" conproperty="-1" command="ACTION" cmdproperty="2" sound="cursor.wav" /> + <action layer="2" condition="*" conproperty="-1" command="ACTION" cmdproperty="103" sound="cursor.wav" /> + </button> + <button name="Fullscreen" code="46"> + <action layer="0" condition="WINDOW" conproperty="11" command="ACTION" cmdproperty="47" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdproperty="10" sound="back.wav" /> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="105" sound="click.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="7" sound="click.wav" /> + </button> + <button name="Mute" code="13"> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="9982" sound="click.wav" /> + </button> + <button name="Source" code="34"> + <action layer="0" condition="*" conproperty="-1" command="TOGGLE" cmdproperty="-1" sound="click.wav" /> + </button> + <button name="1" code="1"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="37" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="49" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="2" code="2"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="38" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="50" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="3" code="3"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="39" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="51" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="4" code="4"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="40" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="52" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="5" code="5"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="41" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="53" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="6" code="6"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="42" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="54" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="7" code="7"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="43" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="55" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="8" code="8"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="44" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="56" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="9" code="9"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="45" sound="cursor.wav" /> + <action layer="0" condition="*" conproperty="-1" command="ACTION" cmdproperty="93" cmdkeychar="57" cmdkeycode="0" sound="cursor.wav" /> + </button> + <button name="0" code="0"> + <action layer="0" condition="WINDOW" conproperty="2007" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="2" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="25" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="603" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="605" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="606" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="501" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="601" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="759" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="6" command="ACTION" cmdproperty="80" sound="click.wav" /> + <action layer="0" condition="WINDOW" conproperty="10" command="ACTION" cmdpr... [truncated message content] |
From: <pra...@us...> - 2008-03-17 14:15:20
|
Revision: 1479 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1479&view=rev Author: prashantv Date: 2008-03-17 07:14:49 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Add XBMCServer plugin to svn Added Paths: ----------- trunk/plugins/Commands/ trunk/plugins/Commands/CloseConnection.cs trunk/plugins/Commands/CommandHandler.cs trunk/plugins/Commands/ListChannels.cs trunk/plugins/Commands/ListGroups.cs trunk/plugins/Commands/StopTimeshift.cs trunk/plugins/Commands/TimeshiftChannel.cs trunk/plugins/ConnectionHandler.cs trunk/plugins/Listener.cs trunk/plugins/Plugin.cs trunk/plugins/Properties/ trunk/plugins/Properties/AssemblyInfo.cs trunk/plugins/TV/ trunk/plugins/TV/ServerInterface.cs trunk/plugins/TV/Utils.cs trunk/plugins/TV/frmMain.cs trunk/plugins/TV/frmMain.designer.cs trunk/plugins/TV/frmMain.resx trunk/plugins/TVServer Live TV/ trunk/plugins/TVServer Live TV/MpLiveTv/ trunk/plugins/TVServer Live TV/MpLiveTv/.MpTVConnector.py.swp trunk/plugins/TVServer Live TV/MpLiveTv/MpTVConnector.py trunk/plugins/TVServer Live TV/MpLiveTv/MpTVConnector.pyo trunk/plugins/TVServer Live TV/MpLiveTv/__init__.py trunk/plugins/TVServer Live TV/MpLiveTv/__init__.pyo trunk/plugins/TVServer Live TV/MpLiveTv/xbmcplugin_list.py trunk/plugins/TVServer Live TV/MpLiveTv/xbmcplugin_list.pyo trunk/plugins/TVServer Live TV/default.py trunk/plugins/TVServer Live TV/default.tbn trunk/plugins/TVServer Live TV/resources/ trunk/plugins/TVServer Live TV/resources/language/ trunk/plugins/TVServer Live TV/resources/language/english/ trunk/plugins/TVServer Live TV/resources/language/english/strings.xml trunk/plugins/TVServer Live TV/resources/settings.xml trunk/plugins/TVServerConnection.cs trunk/plugins/TVServerXBMC.csproj trunk/plugins/TVServerXBMC.sln trunk/plugins/TVServerXBMC.suo trunk/plugins/bin/ trunk/plugins/bin/Debug/ trunk/plugins/bin/Debug/DirectShowLib.dll trunk/plugins/bin/Debug/DirectShowLib.pdb trunk/plugins/bin/Debug/Gentle.Common.dll trunk/plugins/bin/Debug/Gentle.Framework.dll trunk/plugins/bin/Debug/Gentle.Provider.MySQL.dll trunk/plugins/bin/Debug/Gentle.Provider.SQLServer.dll trunk/plugins/bin/Debug/Gentle.config trunk/plugins/bin/Debug/MySql.Data.dll trunk/plugins/bin/Debug/PluginBase.dll trunk/plugins/bin/Debug/PluginBase.pdb trunk/plugins/bin/Debug/SetupControls.dll trunk/plugins/bin/Debug/SetupControls.pdb trunk/plugins/bin/Debug/TVDatabase.dll trunk/plugins/bin/Debug/TVDatabase.pdb trunk/plugins/bin/Debug/TVLibrary.dll trunk/plugins/bin/Debug/TvControl.dll trunk/plugins/bin/Debug/TvControl.pdb trunk/plugins/bin/Debug/TvControl.xml trunk/plugins/bin/Debug/TvLibrary.Interfaces.dll trunk/plugins/bin/Debug/TvLibrary.Interfaces.pdb trunk/plugins/bin/Debug/TvLibrary.Interfaces.xml trunk/plugins/bin/Debug/log4net.dll trunk/plugins/bin/Release/ trunk/plugins/bin/Release/Gentle.Common.dll trunk/plugins/bin/Release/Gentle.Framework.dll trunk/plugins/bin/Release/Gentle.Provider.MySQL.dll trunk/plugins/bin/Release/Gentle.Provider.SQLServer.dll trunk/plugins/bin/Release/Gentle.config trunk/plugins/bin/Release/MySql.Data.dll trunk/plugins/bin/Release/PluginBase.dll trunk/plugins/bin/Release/PluginBase.pdb trunk/plugins/bin/Release/SetupControls.dll trunk/plugins/bin/Release/TVDatabase.dll trunk/plugins/bin/Release/TVDatabase.pdb trunk/plugins/bin/Release/TVLibrary.dll trunk/plugins/bin/Release/TVServerXBMC.dll trunk/plugins/bin/Release/TVServerXBMC.pdb trunk/plugins/bin/Release/TvControl.dll trunk/plugins/bin/Release/TvLibrary.Interfaces.dll trunk/plugins/bin/Release/log4net.dll Added: trunk/plugins/Commands/CloseConnection.cs =================================================================== --- trunk/plugins/Commands/CloseConnection.cs (rev 0) +++ trunk/plugins/Commands/CloseConnection.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TVServerXBMC.Commands +{ + class CloseConnection : CommandHandler + { + + public CloseConnection(ConnectionHandler connection) : base(connection) + { + + } + + public override void handleCommand(string command, string[] arguments) + { + // does not matter what arguments it has. + + getConnection().Disconnect(); + } + + public override string getCommandToHandle() + { + return "CloseConnection"; + } + + } +} Added: trunk/plugins/Commands/CommandHandler.cs =================================================================== --- trunk/plugins/Commands/CommandHandler.cs (rev 0) +++ trunk/plugins/Commands/CommandHandler.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TVServerXBMC.Commands +{ + abstract class CommandHandler + { + private ConnectionHandler connection; + + public CommandHandler(ConnectionHandler connection) + { + this.connection = connection; + } + + public ConnectionHandler getConnection() + { + return this.connection; + } + + public abstract void handleCommand(String command, String[] arguments); + public abstract String getCommandToHandle(); + } +} Added: trunk/plugins/Commands/ListChannels.cs =================================================================== --- trunk/plugins/Commands/ListChannels.cs (rev 0) +++ trunk/plugins/Commands/ListChannels.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MPTvClient; + +namespace TVServerXBMC.Commands +{ + class ListChannels : CommandHandler + { + public ListChannels(ConnectionHandler connection) : base(connection) + { + + } + + public override void handleCommand(string command, string[] arguments) + { + // we want to list all channels in group arg[0] + String group = arguments[0]; + List<string> results = new List<string>(); + + List<ChannelInfo> channels = TVServerConnection.getChannels(group); + foreach(ChannelInfo c in channels) + { + results.Add(c.channelID + ";" + c.name); + Console.WriteLine("CHANNEL : " + c.channelID + ";" + c.name); + } + + getConnection().writeList(results); + } + + public override string getCommandToHandle() + { + return "ListChannels"; + } + } +} Added: trunk/plugins/Commands/ListGroups.cs =================================================================== --- trunk/plugins/Commands/ListGroups.cs (rev 0) +++ trunk/plugins/Commands/ListGroups.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TVServerXBMC.Commands +{ + class ListGroups : CommandHandler + { + public ListGroups(ConnectionHandler connection) + : base(connection) + { + } + public override void handleCommand(string command, string[] arguments) + { + // this needs no arguments, and will just list all the groups + + List<String> groups = TVServerConnection.getGroups(); + foreach (String group in groups) + { + Console.WriteLine("GROUP : " + group); + } + + getConnection().writeList(groups); + + } + + public override string getCommandToHandle() + { + return "ListGroups"; + } + } +} Added: trunk/plugins/Commands/StopTimeshift.cs =================================================================== --- trunk/plugins/Commands/StopTimeshift.cs (rev 0) +++ trunk/plugins/Commands/StopTimeshift.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TVServerXBMC.Commands +{ + class StopTimeshift : CommandHandler + { + public StopTimeshift(ConnectionHandler connection) + : base(connection) + { + + } + /* + * No arguments needed + */ + public override void handleCommand(string command, string[] arguments) + { + bool result = TVServerConnection.StopTimeshift(); + Console.WriteLine("StopTimeshift result : " + result.ToString()); + getConnection().WriteLine(result.ToString()); + } + + public override string getCommandToHandle() + { + return "StopTimeshift"; + } + } +} Added: trunk/plugins/Commands/TimeshiftChannel.cs =================================================================== --- trunk/plugins/Commands/TimeshiftChannel.cs (rev 0) +++ trunk/plugins/Commands/TimeshiftChannel.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TVServerXBMC.Commands +{ + class TimeshiftChannel : CommandHandler + { + public TimeshiftChannel(ConnectionHandler connection) + : base(connection) + { + + } + + /* + * Expect arguments: ChannelID + */ + public override void handleCommand(string command, string[] arguments) + { + if (arguments.Length < 1) + { + getConnection().WriteLine(getCommandToHandle() + " expects arguments ChannelId"); + return; + } + + int chanId = int.Parse(arguments[0]); + + String result = TVServerConnection.playChannel(chanId); + getConnection().WriteLine(result); + + } + + public override string getCommandToHandle() + { + return "TimeshiftChannel"; + } + } +} Added: trunk/plugins/ConnectionHandler.cs =================================================================== --- trunk/plugins/ConnectionHandler.cs (rev 0) +++ trunk/plugins/ConnectionHandler.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.Sockets; +using System.Threading; +using System.Net; +using System.IO; + +using TVServerXBMC.Commands; + +namespace TVServerXBMC +{ + class ConnectionHandler + { + private TcpClient client; + private Dictionary<String, CommandHandler> allHandlers; + + public ConnectionHandler(TcpClient client) + { + this.client = client; + addHandlers(); + } + + private void addHandlers() + { + List<CommandHandler> handlers = new List<CommandHandler>(); + allHandlers = new Dictionary<String,CommandHandler>(); + + handlers.Add(new ListChannels(this)); + handlers.Add(new ListGroups(this)); + handlers.Add(new CloseConnection(this)); + handlers.Add(new TimeshiftChannel(this)); + handlers.Add(new StopTimeshift(this)); + + foreach(CommandHandler h in handlers) + { + allHandlers.Add(h.getCommandToHandle().ToLower(), h); + } + + } + + + + public void writeList(List<string> list) + { + // escape every value + List<string> escaped = list.ConvertAll<string>(new Converter<string, string>(Uri.EscapeDataString)); + + // send it as one line + WriteLine(String.Join(",",escaped.ToArray())); + + Console.WriteLine(String.Join(",", escaped.ToArray())); + } + + public void HandleConnection() + { + NetworkStream cStream = this.client.GetStream(); + StreamReader reader = new StreamReader(cStream); + + // first we get what version of the protocol + // we expect "TVServerXBMC0-1" + String versionInfo = reader.ReadLine(); + if (versionInfo == null) return; + + if (versionInfo.Contains("TVServerXBMC:0-1")) + { + WriteLine("Protocol-Accept:1"); + Console.WriteLine("Correct protocol, connection accepted!"); + } + else + { + WriteLine("Unexpected Protocol"); + client.Close(); + Console.WriteLine("Unexpected protocol"); + return; + } + + ProcessConnection(reader); + + } + + public void WriteLine(String line) + { + StreamWriter writer = new StreamWriter(this.client.GetStream ()); + writer.WriteLine(line); + writer.Flush(); + } + + public void Disconnect() + { + client.Close(); + } + + + private void handleCommand(String command, String[] arguments) + { + String handleCommand = command.ToLower(); + if (allHandlers.ContainsKey(handleCommand)) + { + allHandlers[handleCommand].handleCommand(command, arguments); + } + else + { + WriteLine("UnknownCommand:" + command); + Console.WriteLine("Unknown command : " + command); + } + + + } + + private void ProcessConnection(StreamReader reader) + { + try + { + while (client.Connected) + { + String line = reader.ReadLine(); + + // every command is Command:Argument,Argument,Argument + // where the arguments are uri encoded. Commands are not encoded + String[] parts = line.Split(new Char[] { ':' }, 2); + + if (parts.Length < 2) + { + Console.WriteLine("Command format incorrect"); + WriteLine("Command format incorrect"); + return; + } + + + + String command = parts[0]; + String[] arguments = parts[1].Split(new Char[] { ',' }); + + for (int i = 0; i < arguments.Length; i++) + { + arguments[i] = System.Uri.UnescapeDataString(arguments[i]); + } + + Console.WriteLine("Handling command; " + command); + handleCommand(command, arguments); + } + + + } + catch (Exception e) + { + Console.WriteLine("Excpetion while processing connection : " + e.ToString()); + } + Console.WriteLine("Connection closed"); + } + + + + + } +} Added: trunk/plugins/Listener.cs =================================================================== --- trunk/plugins/Listener.cs (rev 0) +++ trunk/plugins/Listener.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.Sockets; +using System.Threading; +using System.Net; + +namespace TVServerXBMC +{ + class Listener + { + private TcpListener tcpListener; + + public Listener(){ + this.tcpListener = new TcpListener(IPAddress.Any, PORT); + } + + public const int PORT = 9596; + + public void StartListening() + { + tcpListener.Start(); + + ListenForClients(); + // start a thread to listen for clients + // (new Thread(new ThreadStart(ListenForClients)).Start (); + } + + private void ListenForClients() + { + Console.WriteLine("Waiting for clients..."); + + while (true) + { + // blocks until a client has connected to the server + TcpClient client = this.tcpListener.AcceptTcpClient(); + + Console.WriteLine("New Connection! Not listening for any new connections"); + tcpListener.Stop(); + + ConnectionHandler handler = new ConnectionHandler(client); + handler.HandleConnection(); + + tcpListener.Start(); + Console.WriteLine("Connection complete, listening for new connection.."); + } + } + + + + } +} Added: trunk/plugins/Plugin.cs =================================================================== --- trunk/plugins/Plugin.cs (rev 0) +++ trunk/plugins/Plugin.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Text; +using TvEngine; +using System.Threading; + + +namespace TVServerXBMC +{ + public class XmlTvImporter : ITvServerPlugin + { + Thread listenThread; + + public string Author + { + get { return "Prashant V"; } + } + + public bool MasterOnly + { + get { return true; } + } + + public string Name + { + get { return "XBMC Server"; } + } + + public SetupTv.SectionSettings Setup + { + get { return null; } + } + + public void Start(TvControl.IController controller) + { + // set up our remote control interface + TVServerConnection.Init(controller); + + // start a thread for the listener + Listener l = new Listener(); + listenThread = new Thread(new ThreadStart(l.StartListening)); + listenThread.Start(); + } + + public void Stop() + { + if (listenThread != null) + { + listenThread.Abort(); + listenThread = null; + } + } + + public string Version + { + get { return "0.2.0.0"; } + } + } + +} Added: trunk/plugins/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/Properties/AssemblyInfo.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TVServerXBMC")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("TVServerXBMC")] +[assembly: AssemblyCopyright("Copyright © Home 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bcee752c-84da-4543-bbd7-c1ccfd8bb46d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/TV/ServerInterface.cs =================================================================== --- trunk/plugins/TV/ServerInterface.cs (rev 0) +++ trunk/plugins/TV/ServerInterface.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,411 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using TvControl; +using TvDatabase; +using TvLibrary.Interfaces; +using Gentle.Common; +using Gentle.Framework; + +namespace MPTvClient +{ + public class TVServerController + { + IList groups; + IList channels; + IList mappings; + IList cards; + IController controller; + User me; + bool _isTimeShifting = false; + public Exception lastException = null; + + #region Connection functions + + public TVServerController(IController controller) + { + this.controller = controller; + } + + public bool Setup() + { + try + { + string connStr; + string provider; + controller.GetDatabaseConnectionString(out connStr, out provider); + Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr); + me = new User(); + me.IsAdmin = true; + groups = ChannelGroup.ListAll(); + channels = Channel.ListAll(); + mappings = GroupMap.ListAll(); + cards = Card.ListAll(); + } + catch (Exception ex) + { + lastException = ex; + return false; + } + return true; + } + public void ResetConnection() + { + _isTimeShifting = false; + } + #endregion + + #region Controll functions + public TvResult StartTimeShifting(int idChannel, ref string rtspURL) + { + if (_isTimeShifting) + StopTimeShifting(); + VirtualCard vcard; + TvResult result; + me = new User(); + try + { + result = controller.StartTimeShifting(ref me, idChannel, out vcard); + } + catch (Exception ex) + { + lastException = ex; + return TvResult.UnknownError; + } + if (result == TvResult.Succeeded) + { + _isTimeShifting = true; + rtspURL = vcard.RTSPUrl; + } + return result; + } + public bool StopTimeShifting() + { + if (!_isTimeShifting) + return true; + bool result; + try + { + result = controller.StopTimeShifting(ref me); + } + catch (Exception ex) + { + lastException = ex; + return false; + } + _isTimeShifting = false; + return result; + } + public string GetRecordingURL(int idRecording) + { + TvServer server = new TvServer(); + string url = server.GetStreamUrlForFileName(idRecording); + return url; + } + public void DeleteRecording(int idRecording) + { + controller.DeleteRecording(idRecording); + } + public void DeleteSchedule(int idSchedule) + { + Schedule sched = Schedule.Retrieve(idSchedule); + sched.Remove(); + + } + #endregion + + #region Info functions + public ReceptionDetails GetReceptionDetails() + { + VirtualCard vcard; + try + { + vcard = new VirtualCard(me, RemoteControl.HostName); + } + catch (Exception ex) + { + lastException = ex; + return null; + } + ReceptionDetails details = new ReceptionDetails(); + details.signalLevel = vcard.SignalLevel; + details.signalQuality = vcard.SignalQuality; + return details; + } + public List<StreamingStatus> GetStreamingStatus() + { + List<StreamingStatus> states = new List<StreamingStatus>(); + VirtualCard vcard; + try + { + foreach (Card card in cards) + { + User user = new User(); + user.CardId = card.IdCard; + User[] usersForCard = controller.GetUsersForCard(card.IdCard); + if (usersForCard == null) + { + StreamingStatus state = new StreamingStatus(); + vcard = new VirtualCard(user, RemoteControl.HostName); + string tmp = "idle"; + if (vcard.IsScanning) tmp = "Scanning"; + if (vcard.IsGrabbingEpg) tmp = "Grabbing EPG"; + state.cardId = card.IdCard; + state.cardName = vcard.Name; + state.cardType = vcard.Type.ToString(); + state.status = tmp; + state.channelName = ""; + state.userName = ""; + states.Add(state); + continue; + } + if (usersForCard.Length == 0) + { + StreamingStatus state = new StreamingStatus(); + vcard = new VirtualCard(user, RemoteControl.HostName); + string tmp = "idle"; + if (vcard.IsScanning) tmp = "Scanning"; + if (vcard.IsGrabbingEpg) tmp = "Grabbing EPG"; + state.cardId = card.IdCard; + state.cardName = vcard.Name; + state.cardType = vcard.Type.ToString(); + state.status = tmp; + state.channelName = ""; + state.userName = ""; + states.Add(state); + continue; + } + for (int i = 0; i < usersForCard.Length; ++i) + { + StreamingStatus state = new StreamingStatus(); + string tmp = "idle"; + vcard = new VirtualCard(usersForCard[i], RemoteControl.HostName); + if (vcard.IsTimeShifting) + tmp = "Timeshifting"; + else + if (vcard.IsRecording) + tmp = "Recording"; + else + if (vcard.IsScanning) + tmp = "Scanning"; + else + if (vcard.IsGrabbingEpg) + tmp = "Grabbing EPG"; + state.cardId = card.IdCard; + state.cardName = vcard.Name; + state.cardType = vcard.Type.ToString(); + state.status = tmp; + state.channelName = vcard.ChannelName; + state.userName = vcard.User.Name; + states.Add(state); + } + } + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return states; + } + public List<string> GetGroupNames() + { + if (!RemoteControl.IsConnected) + return null; + List<string> lGroups = new List<string>(); + try + { + foreach (ChannelGroup group in groups) + lGroups.Add(group.GroupName); + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return lGroups; + } + public List<ChannelInfo> GetChannelInfosForGroup(string groupName) + { + List<ChannelInfo> refChannelInfos = new List<ChannelInfo>(); + try + { + foreach (ChannelGroup group in groups) + { + if (group.GroupName == groupName) + { + IList maps = group.ReferringGroupMap(); + TvDatabase.Program epg; + foreach (GroupMap map in maps) + { + ChannelInfo channelInfo = new ChannelInfo(); + channelInfo.channelID = map.ReferencedChannel().IdChannel.ToString(); + channelInfo.name = map.ReferencedChannel().DisplayName; + epg = map.ReferencedChannel().CurrentProgram; + channelInfo.epgNow = new ProgrammInfo(); + if (epg != null) + { + channelInfo.epgNow.timeInfo = epg.StartTime.ToShortTimeString() + "-" + epg.EndTime.ToShortTimeString(); + channelInfo.epgNow.description = epg.Title; + } + epg = map.ReferencedChannel().NextProgram; + channelInfo.epgNext = new ProgrammInfo(); + if (epg != null) + { + channelInfo.epgNext.timeInfo = epg.StartTime.ToShortTimeString() + "-" + epg.EndTime.ToShortTimeString(); + channelInfo.epgNext.description = epg.Title; + } + refChannelInfos.Add(channelInfo); + } + break; + } + } + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return refChannelInfos; + } + public List<ChannelInfo> GetRadioChannels() + { + List<ChannelInfo> radioChannels = new List<ChannelInfo>(); + try + { + TvDatabase.Program epg; + foreach (Channel chan in channels) + { + if (!chan.IsRadio) + continue; + ChannelInfo channelInfo = new ChannelInfo(); + channelInfo.channelID = chan.IdChannel.ToString(); + channelInfo.name = chan.DisplayName; + channelInfo.isWebStream = chan.IsWebstream(); + epg = chan.CurrentProgram; + channelInfo.epgNow = new ProgrammInfo(); + if (epg != null) + { + channelInfo.epgNow.timeInfo = epg.StartTime.ToShortTimeString() + "-" + epg.EndTime.ToShortTimeString(); + channelInfo.epgNow.description = epg.Title; + } + epg = chan.NextProgram; + channelInfo.epgNext = new ProgrammInfo(); + if (epg != null) + { + channelInfo.epgNext.timeInfo = epg.StartTime.ToShortTimeString() + "-" + epg.EndTime.ToShortTimeString(); + channelInfo.epgNext.description = epg.Title; + } + radioChannels.Add(channelInfo); + } + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return radioChannels; + } + public string GetWebStreamURL(int idChannel) + { + string url = ""; + Channel chan = Channel.Retrieve(idChannel); + IList details = chan.ReferringTuningDetail(); + foreach (TuningDetail detail in details) + { + if (detail.ChannelType == 5) + { + url = detail.Url; + break; + } + } + return url; + } + public List<RecordingInfo> GetRecordings() + { + List<RecordingInfo> recInfos = new List<RecordingInfo>(); + try + { + IList recordings = Recording.ListAll(); + foreach (Recording rec in recordings) + { + RecordingInfo recInfo = new RecordingInfo(); + recInfo.recordingID = rec.IdRecording.ToString(); + recInfo.title = rec.Title; + recInfo.description = rec.Description; + recInfo.genre = rec.Genre; + recInfo.timeInfo = rec.StartTime.ToString() + "-" + rec.EndTime.ToString(); + recInfos.Add(recInfo); + } + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return recInfos; + } + public List<ScheduleInfo> GetSchedules() + { + List<ScheduleInfo> schedInfos = new List<ScheduleInfo>(); + try + { + IList schedules = Schedule.ListAll(); + foreach (Schedule schedule in schedules) + { + ScheduleInfo sched = new ScheduleInfo(); + sched.scheduleID = schedule.IdSchedule.ToString(); + sched.startTime = schedule.StartTime; + sched.endTime = schedule.EndTime; + sched.channelName = schedule.ReferencedChannel().Name; + sched.description = schedule.ProgramName; + ScheduleRecordingType stype = (ScheduleRecordingType)schedule.ScheduleType; + sched.type = stype.ToString(); + + schedInfos.Add(sched); + } + } + catch (Exception ex) + { + lastException = ex; + return null; + } + return schedInfos; + } + private string GetDateTimeString() + { + string provider = Gentle.Framework.ProviderFactory.GetDefaultProvider().Name.ToLower(); + if (provider == "mysql") return "yyyy-MM-dd HH:mm:ss"; + return "yyyyMMdd HH:mm:ss"; + } + public List<EPGInfo> GetEPGForChannel(string idChannel) + { + IFormatProvider mmddFormat = new CultureInfo(String.Empty, false); + List<EPGInfo> infos = new List<EPGInfo>(); + SqlBuilder sb = new SqlBuilder(Gentle.Framework.StatementType.Select, typeof(Program)); + sb.AddConstraint(Operator.Equals, "idChannel", Int32.Parse(idChannel)); + DateTime thisMorning = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); + sb.AddConstraint(String.Format("startTime>='{0}'", thisMorning.ToString(GetDateTimeString(), mmddFormat))); + sb.AddOrderByField(true, "startTime"); + SqlStatement stmt = sb.GetStatement(true); + IList programs = ObjectFactory.GetCollection(typeof(Program), stmt.Execute()); + if (programs != null && programs.Count > 0) + { + foreach (Program prog in programs) + { + EPGInfo epg = new EPGInfo(); + epg.startTime = prog.StartTime; + epg.endTime = prog.EndTime; + epg.title = prog.Title; + epg.description = prog.Description; + infos.Add(epg); + } + } + return infos; + } + + #endregion + } +} Added: trunk/plugins/TV/Utils.cs =================================================================== --- trunk/plugins/TV/Utils.cs (rev 0) +++ trunk/plugins/TV/Utils.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Win32; + +namespace MPTvClient +{ + public class ReceptionDetails + { + public int signalLevel; + public int signalQuality; + } + public class StreamingStatus + { + public int cardId; + public string cardName; + public string cardType; + public string status; + public string channelName; + public string userName; + } + public class ProgrammInfo + { + public string timeInfo; + public string description; + } + public class EPGInfo + { + public DateTime startTime; + public DateTime endTime; + public string title; + public string description; + } + public class ChannelInfo + { + public string channelID; + public string name; + public bool isWebStream; + public ProgrammInfo epgNow; + public ProgrammInfo epgNext; + } + public class RecordingInfo + { + public string recordingID; + public string title; + public string genre; + public string description; + public string timeInfo; + } + public class ScheduleInfo + { + public string scheduleID; + public DateTime startTime; + public DateTime endTime; + public string channelName; + public string description; + public string type; + } +} Added: trunk/plugins/TV/frmMain.cs =================================================================== --- trunk/plugins/TV/frmMain.cs (rev 0) +++ trunk/plugins/TV/frmMain.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,356 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using TvControl; +using TvDatabase; + +namespace MPTvClient +{ + + public partial class frmMain : Form + { + + ServerInterface serverIntf; + ExternalPlayer extPlayer; + + // processed + private void SetDisconected() + { + tmrRefresh.Enabled = false; + extPlayer.Stop(); + serverIntf.ResetConnection(); + StBarLabel.Text = "Not connected."; + StBar.Update(); + MessageBox.Show(serverIntf.lastException.ToString(), "Exception raised", MessageBoxButtons.OK, MessageBoxIcon.Error); + btnConnect.Visible = true; + } + + private void UpdateTVChannels() + { + if (cbGroups.SelectedIndex == -1) + return; + StBarLabel.Text = "Loading referenced channels..."; + StBar.Update(); + List<ChannelInfo> refChannelInfos = serverIntf.GetChannelInfosForGroup(cbGroups.SelectedItem.ToString()); + if (refChannelInfos == null) + SetDisconected(); + gridTVChannels.Rows.Clear(); + foreach (ChannelInfo chanInfo in refChannelInfos) + gridTVChannels.Rows.Add(chanInfo.channelID, chanInfo.name, chanInfo.epgNow.timeInfo + "\n" + chanInfo.epgNext.timeInfo, chanInfo.epgNow.description + "\n" + chanInfo.epgNext.description); + gridTVChannels.AutoResizeColumns(); + StBarLabel.Text = ""; + } + private void UpdateRadioChannels() + { + StBarLabel.Text = "Loading radio channels..."; + StBar.Update(); + List<ChannelInfo> channelInfos = serverIntf.GetRadioChannels(); + if (channelInfos == null) + SetDisconected(); + gridRadioChannels.Rows.Clear(); + foreach (ChannelInfo chanInfo in channelInfos) + { + string type = "DVB"; + if (chanInfo.isWebStream) + type = "WebStream"; + gridRadioChannels.Rows.Add(chanInfo.channelID, chanInfo.name, type, chanInfo.epgNow.timeInfo + "\n" + chanInfo.epgNext.timeInfo, chanInfo.epgNow.description + "\n" + chanInfo.epgNext.description); + } + gridRadioChannels.AutoResizeColumns(); + StBarLabel.Text = ""; + } + private void UpdateRecordings() + { + StBarLabel.Text = "Loading recordings..."; + StBar.Update(); + List<RecordingInfo> recInfos = serverIntf.GetRecordings(); + if (recInfos == null) + SetDisconected(); + gridRecordings.Rows.Clear(); + foreach (RecordingInfo rec in recInfos) + gridRecordings.Rows.Add(rec.recordingID, rec.timeInfo, rec.genre, rec.title, rec.description); + gridRecordings.AutoResizeColumns(); + StBarLabel.Text = ""; + } + private void UpdateSchedules() + { + StBarLabel.Text = "Loading schedules..."; + StBar.Update(); + List<ScheduleInfo> schedInfos = serverIntf.GetSchedules(); + if (schedInfos == null) + SetDisconected(); + gridSchedules.Rows.Clear(); + foreach (ScheduleInfo sched in schedInfos) + gridSchedules.Rows.Add(sched.scheduleID, sched.startTime.ToString(), sched.endTime.ToString(), sched.description, sched.channelName, sched.type); + gridSchedules.AutoResizeColumns(); + StBarLabel.Text = ""; + } + private void cbGroups_SelectedIndexChanged(object sender, EventArgs e) + { + UpdateTVChannels(); + } + private void timer1_Tick(object sender, EventArgs e) + { + if (!extPlayer.IsRunning()) + serverIntf.StopTimeShifting(); + ReceptionDetails recDetails = serverIntf.GetReceptionDetails(); + if (recDetails == null) + { + SetDisconected(); + return; + } + prLevel.Value = recDetails.signalLevel; + prQuality.Value = recDetails.signalQuality; + List<StreamingStatus> statusList = serverIntf.GetStreamingStatus(); + if (statusList == null) + { + SetDisconected(); + return; + } + lvStatus.Items.Clear(); + foreach (StreamingStatus sstate in statusList) + { + ListViewItem item = lvStatus.Items.Add(sstate.cardId.ToString()); + item.SubItems.Add(sstate.cardName); + item.SubItems.Add(sstate.cardType); + item.SubItems.Add(sstate.status); + item.SubItems.Add(sstate.channelName); + item.SubItems.Add(sstate.userName); + } + lvStatus.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + } + + private void gridChannels_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + StBarLabel.Text = "Trying to start timeshifting..."; + StBar.Update(); + serverIntf.StopTimeShifting(); + extPlayer.Stop(); + string rtspURL = ""; + TvResult result = serverIntf.StartTimeShifting(int.Parse(gridTVChannels.SelectedRows[0].Cells[0].Value.ToString()), ref rtspURL); + StBarLabel.Text = ""; + StBar.Update(); + if (result != TvResult.Succeeded) + MessageBox.Show("Could not start timeshifting\nReason: " + result.ToString()); + else + { + string args = string.Format(ClientSettings.playerArgs, rtspURL); + if (!extPlayer.Start(ClientSettings.playerPath, args)) + MessageBox.Show("Failed to start external player.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void frmMain_FormClosing(object sender, FormClosingEventArgs e) + { + if (extPlayer.IsRunning()) + extPlayer.Stop(); + serverIntf.StopTimeShifting(); + serverIntf.ResetConnection(); + ClientSettings.frmLeft = this.Left; + ClientSettings.frmTop = this.Top; + ClientSettings.frmWidth = this.Width; + ClientSettings.frmHeight = this.Height; + ClientSettings.Save(); + } + + + private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + + } + + private void refreshToolStripMenuItem_Click(object sender, EventArgs e) + { + switch (tabCtrl.SelectedIndex) + { + case 0: + UpdateTVChannels(); + break; + case 1: + UpdateRadioChannels(); + break; + case 2: + UpdateRecordings(); + break; + case 3: + UpdateSchedules(); + break; + } + } + + private void gridTVChannels_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + StBarLabel.Text = "Trying to start timeshifting..."; + StBar.Update(); + serverIntf.StopTimeShifting(); + extPlayer.Stop(); + string rtspURL = ""; + TvResult result = serverIntf.StartTimeShifting(int.Parse(gridTVChannels.SelectedRows[0].Cells[0].Value.ToString()), ref rtspURL); + StBarLabel.Text = ""; + StBar.Update(); + if (result != TvResult.Succeeded) + MessageBox.Show("Could not start timeshifting\nReason: " + result.ToString()); + else + { + if (ClientSettings.useOverride) + rtspURL = ClientSettings.overrideURL; + string args = string.Format(ClientSettings.playerArgs, rtspURL); + if (!extPlayer.Start(ClientSettings.playerPath, args)) + MessageBox.Show("Failed to start external player.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void gridRadioChannels_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + serverIntf.StopTimeShifting(); + extPlayer.Stop(); + string rtspURL = ""; + if (gridRadioChannels.SelectedRows[0].Cells[2].Value.ToString() == "DVB") + { + StBarLabel.Text = "Trying to start timeshifting..."; + StBar.Update(); + TvResult result = serverIntf.StartTimeShifting(int.Parse(gridRadioChannels.SelectedRows[0].Cells[0].Value.ToString()), ref rtspURL); + StBarLabel.Text = ""; + StBar.Update(); + if (result != TvResult.Succeeded) + MessageBox.Show("Could not start timeshifting\nReason: " + result.ToString()); + } + else + rtspURL = serverIntf.GetWebStreamURL(int.Parse(gridRadioChannels.SelectedRows[0].Cells[0].Value.ToString())); + if (ClientSettings.useOverride) + rtspURL = ClientSettings.overrideURL; + string args = string.Format(ClientSettings.playerArgs, rtspURL); + if (!extPlayer.Start(ClientSettings.playerPath, args)) + MessageBox.Show("Failed to start external player.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + private void gridRecordings_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + StBarLabel.Text = "Trying to replay recording..."; + StBar.Update(); + serverIntf.StopTimeShifting(); + extPlayer.Stop(); + string rtspURL = serverIntf.GetRecordingURL(int.Parse(gridRecordings.SelectedRows[0].Cells[0].Value.ToString())); + StBarLabel.Text = ""; + StBar.Update(); + if (rtspURL == "") + MessageBox.Show("Could not start recording"); + else + { + string args = string.Format(ClientSettings.playerArgs, rtspURL); + if (!extPlayer.Start(ClientSettings.playerPath, args)) + MessageBox.Show("Failed to start external player.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) + { + miTimeShift.Visible = false; + miReplay.Visible = false; + miDelete.Visible = false; + switch (tabCtrl.SelectedIndex) + { + case 0: + miTimeShift.Visible = true; + break; + case 1: + miTimeShift.Visible = true; + break; + case 2: + miReplay.Visible = true; + miDelete.Visible = true; + break; + case 3: + miDelete.Visible = true; + break; + } + } + + private void miRefresh_Click(object sender, EventArgs e) + { + refreshToolStripMenuItem_Click(sender, e); + } + + private void miTimeShift_Click(object sender, EventArgs e) + { + if (tabCtrl.SelectedIndex == 0) + gridTVChannels_CellDoubleClick(sender, null); + if (tabCtrl.SelectedIndex == 1) + gridRadioChannels_CellDoubleClick(sender, null); + } + + private void miReplay_Click(object sender, EventArgs e) + { + gridRecordings_CellDoubleClick(sender, null); + } + + private void miDelete_Click(object sender, EventArgs e) + { + if (tabCtrl.SelectedIndex == 2) + { + string idRecording = gridRecordings.SelectedRows[0].Cells[0].Value.ToString(); + if (idRecording == "") + return; + serverIntf.DeleteRecording(int.Parse(idRecording)); + UpdateRecordings(); + } + if (tabCtrl.SelectedIndex == 3) + { + string idSchedule = gridSchedules.SelectedRows[0].Cells[0].Value.ToString(); + if (idSchedule == "") + return; + serverIntf.DeleteSchedule(int.Parse(idSchedule)); + UpdateSchedules(); + } + } + + private void btnShowEPG_Click(object sender, EventArgs e) + { + List<ChannelInfo> infos = new List<ChannelInfo>(); + foreach (DataGridViewRow row in gridTVChannels.Rows) + { + ChannelInfo info = new ChannelInfo(); + info.channelID = row.Cells[0].Value.ToString(); + info.name = row.Cells[1].Value.ToString(); + infos.Add(info); + } + } + + private void frmMain_Shown(object sender, EventArgs e) + { + if (ClientSettings.frmLeft != 0 && ClientSettings.frmTop != 0) + { + this.Left = ClientSettings.frmLeft; + this.Top = ClientSettings.frmTop; + this.Width = ClientSettings.frmWidth; + this.Height = ClientSettings.frmHeight; + } + } + private bool Test() + { + bool yes = false; + try + { + yes = true; + return yes; + } + catch (Exception ex) + { + MessageBox.Show("Exception"); + } + finally + { + MessageBox.Show("finally"); + } + return false; + } + private void button1_Click(object sender, EventArgs e) + { + MessageBox.Show("Returned: " + Test().ToString()); + } + } +} \ No newline at end of file Added: trunk/plugins/TV/frmMain.designer.cs =================================================================== --- trunk/plugins/TV/frmMain.designer.cs (rev 0) +++ trunk/plugins/TV/frmMain.designer.cs 2008-03-17 14:14:49 UTC (rev 1479) @@ -0,0 +1,837 @@ +namespace MPTvClient +{ + partial class frmMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + this.btnConnect = new System.Windows.Forms.Button(); + this.StBar = new System.Windows.Forms.StatusStrip(); + this.StBarLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.prQuality = new System.Windows.Forms.ProgressBar(); + this.label3 = new System.Windows.Forms.Label(); + this.prLevel = new System.Windows.Forms.ProgressBar(); + this.label2 = new System.Windows.Forms.Label(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.serverConnectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.externalPlayerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.refreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tmrRefresh = new System.Windows.Forms.Timer(this.components); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.tabCtrl = new System.Windows.Forms.TabControl(); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.miTimeShift = new System.Windows.Forms.ToolStripMenuItem(); + this.miReplay = new System.Windows.Forms.ToolStripMenuItem(); + this.miDelete = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.miRefresh = new System.Windows.Forms.ToolStripMenuItem(); + this.tpTV = new System.Windows.Forms.TabPage(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.btnShowEPG = new System.Windows.Forms.Button(); + this.cbGroups = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.gridTVChannels = new System.Windows.Forms.DataGridView(); + this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tpRadio = new System.Windows.Forms.TabPage(); + this.gridRadioChannels = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Type = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tpRecordings = new System.Windows.Forms.TabPage(); + this.gridRecordings = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colGenre = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.tpSchedules = new System.Windows.Forms.TabPage(); + this.gridSchedules = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.lvStatus = new System.Windows.Forms.ListView(); + this.colCardId = new System.Windows.Forms.ColumnHeader(); + this.colCardName = new System.Windows.Forms.ColumnHeader(); + this.colCardType = new System.Windows.Forms.ColumnHeader(); + this.colStatus = new System.Windows.Forms.ColumnHeader(); + this.colChannel = new System.Windows.Forms.ColumnHeader(); + this.colUser = new System.Windows.Forms.ColumnHeader(); + this.button1 = new System.Windows.Forms.Button(); + this.StBar.SuspendLayout(); + this.panel1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.tabCtrl.SuspendLayout(); + this.contextMenuStrip1.SuspendLayout(); + this.tpTV.SuspendLayout(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridTVChannels)).BeginInit(); + this.tpRadio.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridRadioChannels)).BeginInit(); + this.tpRecordings.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridRecordings)).BeginInit(); + this.tpSchedules.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.gridSchedules)).BeginInit(); + this.SuspendLayout(); + // StBar + // + this.StBar.Items.AddRange(new System.Windows.Forms.ToolS... [truncated message content] |
From: <pra...@us...> - 2008-03-17 14:34:44
|
Revision: 1480 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1480&view=rev Author: prashantv Date: 2008-03-17 07:33:53 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Fix up svn import not putting the files in the right folder. Modified Paths: -------------- trunk/plugins/XBMCServer/bin/Release/TVServerXBMC.dll trunk/plugins/XBMCServer/bin/Release/TVServerXBMC.pdb Added Paths: ----------- trunk/plugins/XBMCServer/ trunk/plugins/XBMCServer/Commands/ trunk/plugins/XBMCServer/ConnectionHandler.cs trunk/plugins/XBMCServer/Listener.cs trunk/plugins/XBMCServer/Plugin.cs trunk/plugins/XBMCServer/Properties/ trunk/plugins/XBMCServer/TV/ trunk/plugins/XBMCServer/TVServerConnection.cs trunk/plugins/XBMCServer/TVServerXBMC.csproj trunk/plugins/XBMCServer/TVServerXBMC.sln trunk/plugins/XBMCServer/TVServerXBMC.suo trunk/plugins/XBMCServer/bin/ Removed Paths: ------------- trunk/plugins/Commands/ trunk/plugins/ConnectionHandler.cs trunk/plugins/Listener.cs trunk/plugins/Plugin.cs trunk/plugins/Properties/ trunk/plugins/TV/ trunk/plugins/TVServerConnection.cs trunk/plugins/TVServerXBMC.csproj trunk/plugins/TVServerXBMC.sln trunk/plugins/TVServerXBMC.suo trunk/plugins/bin/ Deleted: trunk/plugins/ConnectionHandler.cs =================================================================== --- trunk/plugins/ConnectionHandler.cs 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/ConnectionHandler.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,157 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Net.Sockets; -using System.Threading; -using System.Net; -using System.IO; - -using TVServerXBMC.Commands; - -namespace TVServerXBMC -{ - class ConnectionHandler - { - private TcpClient client; - private Dictionary<String, CommandHandler> allHandlers; - - public ConnectionHandler(TcpClient client) - { - this.client = client; - addHandlers(); - } - - private void addHandlers() - { - List<CommandHandler> handlers = new List<CommandHandler>(); - allHandlers = new Dictionary<String,CommandHandler>(); - - handlers.Add(new ListChannels(this)); - handlers.Add(new ListGroups(this)); - handlers.Add(new CloseConnection(this)); - handlers.Add(new TimeshiftChannel(this)); - handlers.Add(new StopTimeshift(this)); - - foreach(CommandHandler h in handlers) - { - allHandlers.Add(h.getCommandToHandle().ToLower(), h); - } - - } - - - - public void writeList(List<string> list) - { - // escape every value - List<string> escaped = list.ConvertAll<string>(new Converter<string, string>(Uri.EscapeDataString)); - - // send it as one line - WriteLine(String.Join(",",escaped.ToArray())); - - Console.WriteLine(String.Join(",", escaped.ToArray())); - } - - public void HandleConnection() - { - NetworkStream cStream = this.client.GetStream(); - StreamReader reader = new StreamReader(cStream); - - // first we get what version of the protocol - // we expect "TVServerXBMC0-1" - String versionInfo = reader.ReadLine(); - if (versionInfo == null) return; - - if (versionInfo.Contains("TVServerXBMC:0-1")) - { - WriteLine("Protocol-Accept:1"); - Console.WriteLine("Correct protocol, connection accepted!"); - } - else - { - WriteLine("Unexpected Protocol"); - client.Close(); - Console.WriteLine("Unexpected protocol"); - return; - } - - ProcessConnection(reader); - - } - - public void WriteLine(String line) - { - StreamWriter writer = new StreamWriter(this.client.GetStream ()); - writer.WriteLine(line); - writer.Flush(); - } - - public void Disconnect() - { - client.Close(); - } - - - private void handleCommand(String command, String[] arguments) - { - String handleCommand = command.ToLower(); - if (allHandlers.ContainsKey(handleCommand)) - { - allHandlers[handleCommand].handleCommand(command, arguments); - } - else - { - WriteLine("UnknownCommand:" + command); - Console.WriteLine("Unknown command : " + command); - } - - - } - - private void ProcessConnection(StreamReader reader) - { - try - { - while (client.Connected) - { - String line = reader.ReadLine(); - - // every command is Command:Argument,Argument,Argument - // where the arguments are uri encoded. Commands are not encoded - String[] parts = line.Split(new Char[] { ':' }, 2); - - if (parts.Length < 2) - { - Console.WriteLine("Command format incorrect"); - WriteLine("Command format incorrect"); - return; - } - - - - String command = parts[0]; - String[] arguments = parts[1].Split(new Char[] { ',' }); - - for (int i = 0; i < arguments.Length; i++) - { - arguments[i] = System.Uri.UnescapeDataString(arguments[i]); - } - - Console.WriteLine("Handling command; " + command); - handleCommand(command, arguments); - } - - - } - catch (Exception e) - { - Console.WriteLine("Excpetion while processing connection : " + e.ToString()); - } - Console.WriteLine("Connection closed"); - } - - - - - } -} Deleted: trunk/plugins/Listener.cs =================================================================== --- trunk/plugins/Listener.cs 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/Listener.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Net.Sockets; -using System.Threading; -using System.Net; - -namespace TVServerXBMC -{ - class Listener - { - private TcpListener tcpListener; - - public Listener(){ - this.tcpListener = new TcpListener(IPAddress.Any, PORT); - } - - public const int PORT = 9596; - - public void StartListening() - { - tcpListener.Start(); - - ListenForClients(); - // start a thread to listen for clients - // (new Thread(new ThreadStart(ListenForClients)).Start (); - } - - private void ListenForClients() - { - Console.WriteLine("Waiting for clients..."); - - while (true) - { - // blocks until a client has connected to the server - TcpClient client = this.tcpListener.AcceptTcpClient(); - - Console.WriteLine("New Connection! Not listening for any new connections"); - tcpListener.Stop(); - - ConnectionHandler handler = new ConnectionHandler(client); - handler.HandleConnection(); - - tcpListener.Start(); - Console.WriteLine("Connection complete, listening for new connection.."); - } - } - - - - } -} Deleted: trunk/plugins/Plugin.cs =================================================================== --- trunk/plugins/Plugin.cs 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/Plugin.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using TvEngine; -using System.Threading; - - -namespace TVServerXBMC -{ - public class XmlTvImporter : ITvServerPlugin - { - Thread listenThread; - - public string Author - { - get { return "Prashant V"; } - } - - public bool MasterOnly - { - get { return true; } - } - - public string Name - { - get { return "XBMC Server"; } - } - - public SetupTv.SectionSettings Setup - { - get { return null; } - } - - public void Start(TvControl.IController controller) - { - // set up our remote control interface - TVServerConnection.Init(controller); - - // start a thread for the listener - Listener l = new Listener(); - listenThread = new Thread(new ThreadStart(l.StartListening)); - listenThread.Start(); - } - - public void Stop() - { - if (listenThread != null) - { - listenThread.Abort(); - listenThread = null; - } - } - - public string Version - { - get { return "0.2.0.0"; } - } - } - -} Deleted: trunk/plugins/TVServerConnection.cs =================================================================== --- trunk/plugins/TVServerConnection.cs 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/TVServerConnection.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using MPTvClient; -using TvControl; - -namespace TVServerXBMC -{ - class TVServerConnection - { - private static TVServerController serverIntf; - - // create our objects and connect! - public static void Init(IController controller) - { - serverIntf = new TVServerController(controller); - serverIntf.Setup(); - } - - // Get a list of <string> groups (channel groups) - public static List<string> getGroups() - { - List<string> groups = serverIntf.GetGroupNames(); - if (groups == null) - { - disconnect(); - return null; - } - - return groups; - } - - - // get a list of all channels - public static List<ChannelInfo> getChannels(String group) - { - List<ChannelInfo> refChannelInfos = serverIntf.GetChannelInfosForGroup(group); - if (refChannelInfos == null) - disconnect(); - - return refChannelInfos; - } - - - // timeshift a channel and get the stream url - public static String playChannel(int chanId) - { - serverIntf.StopTimeShifting(); - string rtspURL = ""; - - TvResult result = serverIntf.StartTimeShifting(chanId, ref rtspURL); - - if (result != TvResult.Succeeded) - { - rtspURL = "[ERROR]:" + result.ToString(); - } - - Console.WriteLine("PlayChannel result : " + rtspURL); - return rtspURL; - } - - public static bool StopTimeshift() - { - bool result = serverIntf.StopTimeShifting(); - return result; - } - - public static void disconnect() - { - serverIntf.ResetConnection(); - } - } -} Deleted: trunk/plugins/TVServerXBMC.csproj =================================================================== --- trunk/plugins/TVServerXBMC.csproj 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/TVServerXBMC.csproj 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,91 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{CE292E6A-53E2-459D-8C87-673073182152}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>TVServerXBMC</RootNamespace> - <AssemblyName>TVServerXBMC</AssemblyName> - <StartupObject> - </StartupObject> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Gentle.Common, Version=1.2.9.1285, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> - <Reference Include="Gentle.Framework, Version=1.2.9.1286, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> - <Reference Include="Gentle.Provider.MySQL, Version=1.2.9.1288, Culture=neutral" /> - <Reference Include="Gentle.Provider.SQLServer, Version=1.2.9.1289, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> - <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905" /> - <Reference Include="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> - <Reference Include="PluginBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>bin\Debug\PluginBase.dll</HintPath> - </Reference> - <Reference Include="SetupControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - <Reference Include="TvControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> - <Reference Include="TVDatabase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>bin\Debug\TVDatabase.dll</HintPath> - </Reference> - <Reference Include="TvLibrary.Interfaces, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Commands\CloseConnection.cs" /> - <Compile Include="Commands\CommandHandler.cs" /> - <Compile Include="Commands\ListChannels.cs" /> - <Compile Include="Commands\ListGroups.cs" /> - <Compile Include="Commands\StopTimeshift.cs" /> - <Compile Include="Commands\TimeshiftChannel.cs" /> - <Compile Include="ConnectionHandler.cs" /> - <Compile Include="Listener.cs" /> - <Compile Include="Plugin.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <None Include="TV\frmMain.cs"> - <SubType>Form</SubType> - </None> - <None Include="TV\frmMain.designer.cs"> - <DependentUpon>frmMain.cs</DependentUpon> - </None> - <Compile Include="TV\ServerInterface.cs" /> - <Compile Include="TVServerConnection.cs" /> - <Compile Include="TV\Utils.cs" /> - </ItemGroup> - <ItemGroup> - <None Include="TV\frmMain.resx"> - <DependentUpon>frmMain.cs</DependentUpon> - <SubType>Designer</SubType> - </None> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file Deleted: trunk/plugins/TVServerXBMC.sln =================================================================== --- trunk/plugins/TVServerXBMC.sln 2008-03-17 14:14:49 UTC (rev 1479) +++ trunk/plugins/TVServerXBMC.sln 2008-03-17 14:33:53 UTC (rev 1480) @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TVServerXBMC", "TVServerXBMC.csproj", "{CE292E6A-53E2-459D-8C87-673073182152}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CE292E6A-53E2-459D-8C87-673073182152}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE292E6A-53E2-459D-8C87-673073182152}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE292E6A-53E2-459D-8C87-673073182152}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE292E6A-53E2-459D-8C87-673073182152}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: trunk/plugins/TVServerXBMC.suo =================================================================== (Binary files differ) Copied: trunk/plugins/XBMCServer/Commands (from rev 1479, trunk/plugins/Commands) Copied: trunk/plugins/XBMCServer/ConnectionHandler.cs (from rev 1479, trunk/plugins/ConnectionHandler.cs) =================================================================== --- trunk/plugins/XBMCServer/ConnectionHandler.cs (rev 0) +++ trunk/plugins/XBMCServer/ConnectionHandler.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.Sockets; +using System.Threading; +using System.Net; +using System.IO; + +using TVServerXBMC.Commands; + +namespace TVServerXBMC +{ + class ConnectionHandler + { + private TcpClient client; + private Dictionary<String, CommandHandler> allHandlers; + + public ConnectionHandler(TcpClient client) + { + this.client = client; + addHandlers(); + } + + private void addHandlers() + { + List<CommandHandler> handlers = new List<CommandHandler>(); + allHandlers = new Dictionary<String,CommandHandler>(); + + handlers.Add(new ListChannels(this)); + handlers.Add(new ListGroups(this)); + handlers.Add(new CloseConnection(this)); + handlers.Add(new TimeshiftChannel(this)); + handlers.Add(new StopTimeshift(this)); + + foreach(CommandHandler h in handlers) + { + allHandlers.Add(h.getCommandToHandle().ToLower(), h); + } + + } + + + + public void writeList(List<string> list) + { + // escape every value + List<string> escaped = list.ConvertAll<string>(new Converter<string, string>(Uri.EscapeDataString)); + + // send it as one line + WriteLine(String.Join(",",escaped.ToArray())); + + Console.WriteLine(String.Join(",", escaped.ToArray())); + } + + public void HandleConnection() + { + NetworkStream cStream = this.client.GetStream(); + StreamReader reader = new StreamReader(cStream); + + // first we get what version of the protocol + // we expect "TVServerXBMC0-1" + String versionInfo = reader.ReadLine(); + if (versionInfo == null) return; + + if (versionInfo.Contains("TVServerXBMC:0-1")) + { + WriteLine("Protocol-Accept:1"); + Console.WriteLine("Correct protocol, connection accepted!"); + } + else + { + WriteLine("Unexpected Protocol"); + client.Close(); + Console.WriteLine("Unexpected protocol"); + return; + } + + ProcessConnection(reader); + + } + + public void WriteLine(String line) + { + StreamWriter writer = new StreamWriter(this.client.GetStream ()); + writer.WriteLine(line); + writer.Flush(); + } + + public void Disconnect() + { + client.Close(); + } + + + private void handleCommand(String command, String[] arguments) + { + String handleCommand = command.ToLower(); + if (allHandlers.ContainsKey(handleCommand)) + { + allHandlers[handleCommand].handleCommand(command, arguments); + } + else + { + WriteLine("UnknownCommand:" + command); + Console.WriteLine("Unknown command : " + command); + } + + + } + + private void ProcessConnection(StreamReader reader) + { + try + { + while (client.Connected) + { + String line = reader.ReadLine(); + + // every command is Command:Argument,Argument,Argument + // where the arguments are uri encoded. Commands are not encoded + String[] parts = line.Split(new Char[] { ':' }, 2); + + if (parts.Length < 2) + { + Console.WriteLine("Command format incorrect"); + WriteLine("Command format incorrect"); + return; + } + + + + String command = parts[0]; + String[] arguments = parts[1].Split(new Char[] { ',' }); + + for (int i = 0; i < arguments.Length; i++) + { + arguments[i] = System.Uri.UnescapeDataString(arguments[i]); + } + + Console.WriteLine("Handling command; " + command); + handleCommand(command, arguments); + } + + + } + catch (Exception e) + { + Console.WriteLine("Excpetion while processing connection : " + e.ToString()); + } + Console.WriteLine("Connection closed"); + } + + + + + } +} Copied: trunk/plugins/XBMCServer/Listener.cs (from rev 1479, trunk/plugins/Listener.cs) =================================================================== --- trunk/plugins/XBMCServer/Listener.cs (rev 0) +++ trunk/plugins/XBMCServer/Listener.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.Sockets; +using System.Threading; +using System.Net; + +namespace TVServerXBMC +{ + class Listener + { + private TcpListener tcpListener; + + public Listener(){ + this.tcpListener = new TcpListener(IPAddress.Any, PORT); + } + + public const int PORT = 9596; + + public void StartListening() + { + tcpListener.Start(); + + ListenForClients(); + // start a thread to listen for clients + // (new Thread(new ThreadStart(ListenForClients)).Start (); + } + + private void ListenForClients() + { + Console.WriteLine("Waiting for clients..."); + + while (true) + { + // blocks until a client has connected to the server + TcpClient client = this.tcpListener.AcceptTcpClient(); + + Console.WriteLine("New Connection! Not listening for any new connections"); + tcpListener.Stop(); + + ConnectionHandler handler = new ConnectionHandler(client); + handler.HandleConnection(); + + tcpListener.Start(); + Console.WriteLine("Connection complete, listening for new connection.."); + } + } + + + + } +} Copied: trunk/plugins/XBMCServer/Plugin.cs (from rev 1479, trunk/plugins/Plugin.cs) =================================================================== --- trunk/plugins/XBMCServer/Plugin.cs (rev 0) +++ trunk/plugins/XBMCServer/Plugin.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Text; +using TvEngine; +using System.Threading; + + +namespace TVServerXBMC +{ + public class XmlTvImporter : ITvServerPlugin + { + Thread listenThread; + + public string Author + { + get { return "Prashant V"; } + } + + public bool MasterOnly + { + get { return true; } + } + + public string Name + { + get { return "XBMC Server"; } + } + + public SetupTv.SectionSettings Setup + { + get { return null; } + } + + public void Start(TvControl.IController controller) + { + // set up our remote control interface + TVServerConnection.Init(controller); + + // start a thread for the listener + Listener l = new Listener(); + listenThread = new Thread(new ThreadStart(l.StartListening)); + listenThread.Start(); + } + + public void Stop() + { + if (listenThread != null) + { + listenThread.Abort(); + listenThread = null; + } + } + + public string Version + { + get { return "0.2.0.0"; } + } + } + +} Copied: trunk/plugins/XBMCServer/Properties (from rev 1479, trunk/plugins/Properties) Copied: trunk/plugins/XBMCServer/TV (from rev 1479, trunk/plugins/TV) Copied: trunk/plugins/XBMCServer/TVServerConnection.cs (from rev 1479, trunk/plugins/TVServerConnection.cs) =================================================================== --- trunk/plugins/XBMCServer/TVServerConnection.cs (rev 0) +++ trunk/plugins/XBMCServer/TVServerConnection.cs 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Text; +using MPTvClient; +using TvControl; + +namespace TVServerXBMC +{ + class TVServerConnection + { + private static TVServerController serverIntf; + + // create our objects and connect! + public static void Init(IController controller) + { + serverIntf = new TVServerController(controller); + serverIntf.Setup(); + } + + // Get a list of <string> groups (channel groups) + public static List<string> getGroups() + { + List<string> groups = serverIntf.GetGroupNames(); + if (groups == null) + { + disconnect(); + return null; + } + + return groups; + } + + + // get a list of all channels + public static List<ChannelInfo> getChannels(String group) + { + List<ChannelInfo> refChannelInfos = serverIntf.GetChannelInfosForGroup(group); + if (refChannelInfos == null) + disconnect(); + + return refChannelInfos; + } + + + // timeshift a channel and get the stream url + public static String playChannel(int chanId) + { + serverIntf.StopTimeShifting(); + string rtspURL = ""; + + TvResult result = serverIntf.StartTimeShifting(chanId, ref rtspURL); + + if (result != TvResult.Succeeded) + { + rtspURL = "[ERROR]:" + result.ToString(); + } + + Console.WriteLine("PlayChannel result : " + rtspURL); + return rtspURL; + } + + public static bool StopTimeshift() + { + bool result = serverIntf.StopTimeShifting(); + return result; + } + + public static void disconnect() + { + serverIntf.ResetConnection(); + } + } +} Copied: trunk/plugins/XBMCServer/TVServerXBMC.csproj (from rev 1479, trunk/plugins/TVServerXBMC.csproj) =================================================================== --- trunk/plugins/XBMCServer/TVServerXBMC.csproj (rev 0) +++ trunk/plugins/XBMCServer/TVServerXBMC.csproj 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,91 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{CE292E6A-53E2-459D-8C87-673073182152}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TVServerXBMC</RootNamespace> + <AssemblyName>TVServerXBMC</AssemblyName> + <StartupObject> + </StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Gentle.Common, Version=1.2.9.1285, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> + <Reference Include="Gentle.Framework, Version=1.2.9.1286, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> + <Reference Include="Gentle.Provider.MySQL, Version=1.2.9.1288, Culture=neutral" /> + <Reference Include="Gentle.Provider.SQLServer, Version=1.2.9.1289, Culture=neutral, PublicKeyToken=80b5de62e27be49b" /> + <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905" /> + <Reference Include="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> + <Reference Include="PluginBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\PluginBase.dll</HintPath> + </Reference> + <Reference Include="SetupControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="TvControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="TVDatabase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\TVDatabase.dll</HintPath> + </Reference> + <Reference Include="TvLibrary.Interfaces, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Commands\CloseConnection.cs" /> + <Compile Include="Commands\CommandHandler.cs" /> + <Compile Include="Commands\ListChannels.cs" /> + <Compile Include="Commands\ListGroups.cs" /> + <Compile Include="Commands\StopTimeshift.cs" /> + <Compile Include="Commands\TimeshiftChannel.cs" /> + <Compile Include="ConnectionHandler.cs" /> + <Compile Include="Listener.cs" /> + <Compile Include="Plugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <None Include="TV\frmMain.cs"> + <SubType>Form</SubType> + </None> + <None Include="TV\frmMain.designer.cs"> + <DependentUpon>frmMain.cs</DependentUpon> + </None> + <Compile Include="TV\ServerInterface.cs" /> + <Compile Include="TVServerConnection.cs" /> + <Compile Include="TV\Utils.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="TV\frmMain.resx"> + <DependentUpon>frmMain.cs</DependentUpon> + <SubType>Designer</SubType> + </None> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Copied: trunk/plugins/XBMCServer/TVServerXBMC.sln (from rev 1479, trunk/plugins/TVServerXBMC.sln) =================================================================== --- trunk/plugins/XBMCServer/TVServerXBMC.sln (rev 0) +++ trunk/plugins/XBMCServer/TVServerXBMC.sln 2008-03-17 14:33:53 UTC (rev 1480) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TVServerXBMC", "TVServerXBMC.csproj", "{CE292E6A-53E2-459D-8C87-673073182152}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CE292E6A-53E2-459D-8C87-673073182152}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE292E6A-53E2-459D-8C87-673073182152}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE292E6A-53E2-459D-8C87-673073182152}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE292E6A-53E2-459D-8C87-673073182152}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/plugins/XBMCServer/TVServerXBMC.suo (from rev 1479, trunk/plugins/TVServerXBMC.suo) =================================================================== (Binary files differ) Copied: trunk/plugins/XBMCServer/bin (from rev 1479, trunk/plugins/bin) Modified: trunk/plugins/XBMCServer/bin/Release/TVServerXBMC.dll =================================================================== (Binary files differ) Modified: trunk/plugins/XBMCServer/bin/Release/TVServerXBMC.pdb =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-25 06:25:03
|
Revision: 1509 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1509&view=rev Author: and-81 Date: 2008-03-24 23:25:01 -0700 (Mon, 24 Mar 2008) Log Message: ----------- Modified 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/DriverXP.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.designer.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.resx trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/SetupForm.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/SetupForm.resx trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/StbSetup.Designer.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/StbSetup.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/StbSetup.resx trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Icon.ico trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Icon16.ico trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Icon16Connecting.ico trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Icon32.ico trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Media Center Connection.csproj trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/MediaState.reg trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Program.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Properties/ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Properties/Resources.resx trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/References/ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/References/MSASState.dll trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/References/MSASState.dll.config trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/References/MediaState.dll trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/References/MemMapFile.dll trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Tray.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/ Property changes on: trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-03-24 14:12:56 UTC (rev 1508) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -186,6 +186,7 @@ #if DEBUG DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log"); DebugWriteLine("Start()"); + DebugWriteLine("Device Type: {0}", Enum.GetName(typeof(DeviceType), _deviceType)); #endif _notifyWindow = new NotifyWindow(); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-03-24 14:12:56 UTC (rev 1508) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -133,7 +133,7 @@ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - //static readonly byte[] ResetPacket = { 0xFF, 0xEE }; + //static readonly byte[] ResetPacket = { 0xFF, 0xFE }; // Misc Packets static readonly byte[] SetCarrierFreqPacket = { 0x9F, 0x06, 0x01, 0x80 }; @@ -185,6 +185,7 @@ #if DEBUG DebugOpen("MicrosoftMceTransceiver_DriverXP.log"); DebugWriteLine("Start()"); + DebugWriteLine("Device Type: {0}", Enum.GetName(typeof(DeviceType), _deviceType)); #endif _notifyWindow = new NotifyWindow(); @@ -437,7 +438,7 @@ WriteSync(new byte[] { 0x9F, 0x05 }); WriteSync(new byte[] { 0x9F, 0x0D }); WriteSync(new byte[] { 0x9F, 0x13 }); - + Thread.Sleep(4 * PacketTimeout); SetTimeout(PacketTimeout); Property changes on: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/ExternalChannelConfig.cs (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/ExternalChannelConfig.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,302 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; + +namespace MediaCenterConnection +{ + + /// <summary> + /// External Channel Changing configuration file for tuning Set Top Boxes in MediaPortal. + /// </summary> + public class ExternalChannelConfig + { + + #region Constants + + const int DefaultCardID = 0; + + const int DefaultPauseTime = 250; + const bool DefaultSendSelect = false; + const bool DefaultDoubleChannelSelect = false; + const int DefaultRepeatChannelCommands = 0; + const int DefaultChannelDigits = 0; + const int DefaultRepeatPauseTime = 1000; + const bool DefaultUsePreChangeCommand = false; + + #endregion Constants + + #region Variables + + string _fileName; + + int _cardID; + + int _pauseTime; + bool _sendSelect; + bool _doubleChannelSelect; + int _repeatChannelCommands; + int _channelDigits; + int _repeatPauseTime; + bool _usePreChangeCommand; + + string _selectCommand; + string _preChangeCommand; + string[] _digits; + + #endregion Variables + + #region Properties + + /// <summary> + /// Gets the name of the file used to store this configuration. + /// </summary> + /// <value>The name of the file.</value> + public string FileName + { + get { return _fileName; } + } + + /// <summary> + /// Gets or sets the card id. + /// </summary> + /// <value>The card id.</value> + public int CardId + { + get { return _cardID; } + set { _cardID = value; } + } + + /// <summary> + /// Gets or sets the pause time. + /// </summary> + /// <value>The pause time.</value> + public int PauseTime + { + get { return _pauseTime; } + set { _pauseTime = value; } + } + /// <summary> + /// Gets or sets a value indicating whether to send a select command. + /// </summary> + /// <value><c>true</c> if send select; otherwise, <c>false</c>.</value> + public bool SendSelect + { + get { return _sendSelect; } + set { _sendSelect = value; } + } + /// <summary> + /// Gets or sets a value indicating whether to send the select command twice. + /// </summary> + /// <value><c>true</c> if sending channel select twice; otherwise, <c>false</c>.</value> + public bool DoubleChannelSelect + { + get { return _doubleChannelSelect; } + set { _doubleChannelSelect = value; } + } + /// <summary> + /// Gets or sets the flag to repeat channel commands. + /// </summary> + /// <value>The flag to repeat channel commands.</value> + public int RepeatChannelCommands + { + get { return _repeatChannelCommands; } + set { _repeatChannelCommands = value; } + } + /// <summary> + /// Gets or sets the channel digit count. + /// </summary> + /// <value>The number of channel digits.</value> + public int ChannelDigits + { + get { return _channelDigits; } + set { _channelDigits = value; } + } + /// <summary> + /// Gets or sets the pause time between repeats. + /// </summary> + /// <value>The repeat pause time.</value> + public int RepeatPauseTime + { + get { return _repeatPauseTime; } + set { _repeatPauseTime = value; } + } + /// <summary> + /// Gets or sets a value indicating whether to use a pre-change command. + /// </summary> + /// <value> + /// <c>true</c> if using a pre-change command; otherwise, <c>false</c>. + /// </value> + public bool UsePreChangeCommand + { + get { return _usePreChangeCommand; } + set { _usePreChangeCommand = value; } + } + + /// <summary> + /// Gets or sets the digit commands. + /// </summary> + /// <value>The digit commands.</value> + public string[] Digits + { + get { return _digits; } + set { _digits = value; } + } + /// <summary> + /// Gets or sets the select command. + /// </summary> + /// <value>The select command.</value> + public string SelectCommand + { + get { return _selectCommand; } + set { _selectCommand = value; } + } + /// <summary> + /// Gets or sets the pre-change command. + /// </summary> + /// <value>The pre-change command.</value> + public string PreChangeCommand + { + get { return _preChangeCommand; } + set { _preChangeCommand = value; } + } + + #endregion Properties + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="ExternalChannelConfig"/> class. + /// </summary> + /// <param name="fileName">Name of the configuration file.</param> + public ExternalChannelConfig(string fileName) + { + _fileName = fileName; + + _cardID = DefaultCardID; + + _pauseTime = DefaultPauseTime; + _sendSelect = DefaultSendSelect; + _doubleChannelSelect = DefaultDoubleChannelSelect; + _repeatChannelCommands = DefaultRepeatChannelCommands; + _channelDigits = DefaultChannelDigits; + _repeatPauseTime = DefaultRepeatPauseTime; + _usePreChangeCommand = DefaultUsePreChangeCommand; + + _selectCommand = String.Empty; + _preChangeCommand = String.Empty; + _digits = new string[10]; + + for (int i = 0; i < 10; i++) + _digits[i] = String.Empty; + } + + #endregion Constructor + + /// <summary> + /// Saves this instance to its configuration file. + /// </summary> + public void Save() + { + using (XmlTextWriter writer = new XmlTextWriter(_fileName, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("config"); // <config> + + writer.WriteElementString("PauseTime", PauseTime.ToString()); + writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); + writer.WriteElementString("SendSelect", SendSelect.ToString()); + writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); + writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); + writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); + writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); + + writer.WriteElementString("SelectCommand", SelectCommand); + writer.WriteElementString("PreChangeCommand", PreChangeCommand); + + for (int i = 0; i < 10; i++) + writer.WriteElementString("Digit" + i.ToString(), Digits[i]); + + writer.WriteEndElement(); // </config> + writer.WriteEndDocument(); + } + } + + static string GetString(XmlDocument doc, string element, string defaultValue) + { + if (String.IsNullOrEmpty(element)) + return defaultValue; + + XmlNode node = doc.DocumentElement.SelectSingleNode(element); + if (node == null) + return defaultValue; + + return node.InnerText; + } + static int GetInt(XmlDocument doc, string element, int defaultValue) + { + if (String.IsNullOrEmpty(element)) + return defaultValue; + + XmlNode node = doc.DocumentElement.SelectSingleNode(element); + if (node == null) + return defaultValue; + + int returnValue; + if (int.TryParse(node.InnerText, out returnValue)) + return returnValue; + + return defaultValue; + } + static bool GetBool(XmlDocument doc, string element, bool defaultValue) + { + if (String.IsNullOrEmpty(element)) + return defaultValue; + + XmlNode node = doc.DocumentElement.SelectSingleNode(element); + if (node == null) + return defaultValue; + + bool returnValue; + if (bool.TryParse(node.InnerText, out returnValue)) + return returnValue; + + return defaultValue; + } + + /// <summary> + /// Loads the specified file into a new instance of <see cref="ExternalChannelConfig"/> class. + /// </summary> + /// <param name="fileName">Name of the file to load.</param> + /// <returns>A new <see cref="ExternalChannelConfig"/> class instance.</returns> + public static ExternalChannelConfig Load(string fileName) + { + ExternalChannelConfig newECC = new ExternalChannelConfig(fileName); + + XmlDocument doc = new XmlDocument(); + doc.Load(fileName); + + newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); + newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); + newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); + newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); + newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); + newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); + newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); + + newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); + newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); + + for (int index = 0; index < 10; index++) + newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); + + return newECC; + } + + } + +} Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.cs (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,200 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using IrssUtils; + +namespace MediaCenterConnection +{ + + partial class ExternalChannels : Form + { + + #region Variables + + TabPage _tvCardTab; + StbSetup _tvCardStbSetup; + + #endregion Variables + + #region Constructor + + public ExternalChannels() + { + InitializeComponent(); + } + + #endregion Constructor + + private void ExternalChannels_Load(object sender, EventArgs e) + { + _tvCardStbSetup = new StbSetup(0); + _tvCardStbSetup.Name = "StbSetup"; + _tvCardStbSetup.Dock = DockStyle.Fill; + + _tvCardTab = new TabPage("STB"); + _tvCardTab.Controls.Add(_tvCardStbSetup); + + this.tabControlTVCards.TabPages.Add(_tvCardTab); + + // Setup quick setup combo box + string[] quickSetupFiles = Directory.GetFiles(Common.FolderSTB, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in quickSetupFiles) + comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); + + comboBoxQuickSetup.Items.Add("Clear all"); + } + + static void ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString) + { + string[] commands = Common.SplitRunCommand(runCommand); + + commands[2] = commands[2].Replace("%1", currentChannelDigit.ToString()); + commands[2] = commands[2].Replace("%2", fullChannelString); + + Common.ProcessRunCommand(commands); + } + + static void ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString) + { + string[] commands = Common.SplitSerialCommand(serialCommand); + + commands[0] = commands[0].Replace("%1", currentChannelDigit.ToString()); + commands[0] = commands[0].Replace("%2", fullChannelString); + + Common.ProcessSerialCommand(commands); + } + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + try + { + _tvCardStbSetup.Save(); + Tray.ExtChannelConfig.Save(); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString(), "Failed to save external channel setup", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + try + { + StbSetup setup = _tvCardStbSetup; + + int channelTest = Decimal.ToInt32(numericUpDownTest.Value); + string channel; + switch (setup.ChannelDigits) + { + case 2: + channel = channelTest.ToString("00"); + break; + + case 3: + channel = channelTest.ToString("000"); + break; + + case 4: + channel = channelTest.ToString("0000"); + break; + + default: + channel = channelTest.ToString(); + break; + } + + int charVal; + string command; + + for (int repeatCount = 0; repeatCount <= setup.RepeatChannelCommands; repeatCount++) + { + if (repeatCount > 0 && setup.RepeatPauseTime > 0) + Thread.Sleep(setup.RepeatPauseTime); + + if (setup.UsePreChangeCommand && !String.IsNullOrEmpty(setup.PreChangeCommand)) + { + Tray.ProcessExternalCommand(setup.PreChangeCommand, -1, channel); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + + foreach (char digit in channel) + { + charVal = digit - 48; + + command = setup.Digits[charVal]; + if (!String.IsNullOrEmpty(command)) + { + Tray.ProcessExternalCommand(command, charVal, channel); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + } + + if (setup.SendSelect && !String.IsNullOrEmpty(setup.SelectCommand)) + { + Tray.ProcessExternalCommand(setup.SelectCommand, -1, channel); + + if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + Tray.ProcessExternalCommand(setup.SelectCommand, -1, channel); + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString(), "Failed to test external channel", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonQuickSet_Click(object sender, EventArgs e) + { + string quickSetup = comboBoxQuickSetup.Text; + + if (String.IsNullOrEmpty(quickSetup)) + return; + + try + { + _tvCardStbSetup.SetToXml(quickSetup); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString(), "Failed to quick-set external channel setup", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.designer.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,206 @@ +namespace MediaCenterConnection +{ + partial class ExternalChannels + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup = new System.Windows.Forms.GroupBox(); + this.buttonQuickSet = new System.Windows.Forms.Button(); + this.comboBoxQuickSetup = new System.Windows.Forms.ComboBox(); + this.groupBoxTest = new System.Windows.Forms.GroupBox(); + this.labelCh = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.numericUpDownTest = new System.Windows.Forms.NumericUpDown(); + this.tabControlTVCards = new System.Windows.Forms.TabControl(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup.SuspendLayout(); + this.groupBoxTest.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).BeginInit(); + this.SuspendLayout(); + // + // 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(400, 408); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 3; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // groupBoxQuickSetup + // + this.groupBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); + this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 352); + this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; + this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); + this.groupBoxQuickSetup.TabIndex = 1; + this.groupBoxQuickSetup.TabStop = false; + this.groupBoxQuickSetup.Text = "Quick Setup"; + // + // buttonQuickSet + // + this.buttonQuickSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonQuickSet.Location = new System.Drawing.Point(232, 16); + this.buttonQuickSet.Name = "buttonQuickSet"; + this.buttonQuickSet.Size = new System.Drawing.Size(48, 21); + this.buttonQuickSet.TabIndex = 1; + this.buttonQuickSet.Text = "Set"; + this.buttonQuickSet.UseVisualStyleBackColor = true; + this.buttonQuickSet.Click += new System.EventHandler(this.buttonQuickSet_Click); + // + // comboBoxQuickSetup + // + this.comboBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxQuickSetup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxQuickSetup.FormattingEnabled = true; + this.comboBoxQuickSetup.Location = new System.Drawing.Point(8, 16); + this.comboBoxQuickSetup.Name = "comboBoxQuickSetup"; + this.comboBoxQuickSetup.Size = new System.Drawing.Size(216, 21); + this.comboBoxQuickSetup.TabIndex = 0; + // + // groupBoxTest + // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxTest.Controls.Add(this.labelCh); + this.groupBoxTest.Controls.Add(this.buttonTest); + this.groupBoxTest.Controls.Add(this.numericUpDownTest); + this.groupBoxTest.Location = new System.Drawing.Point(304, 352); + this.groupBoxTest.Name = "groupBoxTest"; + this.groupBoxTest.Size = new System.Drawing.Size(216, 48); + this.groupBoxTest.TabIndex = 2; + this.groupBoxTest.TabStop = false; + this.groupBoxTest.Text = "Test"; + // + // labelCh + // + this.labelCh.Location = new System.Drawing.Point(8, 16); + this.labelCh.Name = "labelCh"; + this.labelCh.Size = new System.Drawing.Size(64, 20); + this.labelCh.TabIndex = 0; + this.labelCh.Text = "Channel:"; + this.labelCh.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Location = new System.Drawing.Point(152, 16); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 20); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // numericUpDownTest + // + this.numericUpDownTest.Location = new System.Drawing.Point(72, 16); + this.numericUpDownTest.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.numericUpDownTest.Name = "numericUpDownTest"; + this.numericUpDownTest.Size = new System.Drawing.Size(72, 20); + this.numericUpDownTest.TabIndex = 1; + this.numericUpDownTest.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTest.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // tabControlTVCards + // + this.tabControlTVCards.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.tabControlTVCards.Location = new System.Drawing.Point(8, 8); + this.tabControlTVCards.Name = "tabControlTVCards"; + this.tabControlTVCards.SelectedIndex = 0; + this.tabControlTVCards.Size = new System.Drawing.Size(512, 336); + this.tabControlTVCards.TabIndex = 0; + // + // 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(464, 408); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 4; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // ExternalChannels + // + 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(528, 439); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.tabControlTVCards); + this.Controls.Add(this.groupBoxTest); + this.Controls.Add(this.groupBoxQuickSetup); + this.Controls.Add(this.buttonOK); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 466); + this.Name = "ExternalChannels"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Channel Changing"; + this.Load += new System.EventHandler(this.ExternalChannels_Load); + this.groupBoxQuickSetup.ResumeLayout(false); + this.groupBoxTest.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.GroupBox groupBoxQuickSetup; + private System.Windows.Forms.ComboBox comboBoxQuickSetup; + private System.Windows.Forms.GroupBox groupBoxTest; + private System.Windows.Forms.NumericUpDown numericUpDownTest; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonQuickSet; + private System.Windows.Forms.Label labelCh; + private System.Windows.Forms.TabControl tabControlTVCards; + private System.Windows.Forms.Button buttonCancel; + + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.resx =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.resx (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/ExternalChannels.resx 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,120 @@ +<?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> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.Designer.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,242 @@ +namespace MediaCenterConnection +{ + partial class MacroEditor + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.labelName = new System.Windows.Forms.Label(); + this.textBoxName = new System.Windows.Forms.TextBox(); + this.groupBoxCommandSequence = new System.Windows.Forms.GroupBox(); + this.buttonRemove = new System.Windows.Forms.Button(); + this.buttonMoveDown = new System.Windows.Forms.Button(); + this.buttonMoveUp = new System.Windows.Forms.Button(); + this.listBoxMacro = new System.Windows.Forms.ListBox(); + this.comboBoxCommands = new System.Windows.Forms.ComboBox(); + this.buttonAddCommand = new System.Windows.Forms.Button(); + this.groupBoxCommands = new System.Windows.Forms.GroupBox(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonTest = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxCommandSequence.SuspendLayout(); + this.groupBoxCommands.SuspendLayout(); + this.SuspendLayout(); + // + // labelName + // + this.labelName.Location = new System.Drawing.Point(8, 8); + this.labelName.Name = "labelName"; + this.labelName.Size = new System.Drawing.Size(48, 20); + this.labelName.TabIndex = 0; + this.labelName.Text = "Name:"; + this.labelName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxName + // + this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxName.Location = new System.Drawing.Point(64, 8); + this.textBoxName.Name = "textBoxName"; + this.textBoxName.Size = new System.Drawing.Size(240, 20); + this.textBoxName.TabIndex = 1; + // + // groupBoxCommandSequence + // + this.groupBoxCommandSequence.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.groupBoxCommandSequence.Controls.Add(this.buttonRemove); + this.groupBoxCommandSequence.Controls.Add(this.buttonMoveDown); + this.groupBoxCommandSequence.Controls.Add(this.buttonMoveUp); + this.groupBoxCommandSequence.Controls.Add(this.listBoxMacro); + this.groupBoxCommandSequence.Location = new System.Drawing.Point(8, 40); + this.groupBoxCommandSequence.Name = "groupBoxCommandSequence"; + this.groupBoxCommandSequence.Size = new System.Drawing.Size(296, 192); + this.groupBoxCommandSequence.TabIndex = 2; + this.groupBoxCommandSequence.TabStop = false; + this.groupBoxCommandSequence.Text = "Macro"; + // + // buttonRemove + // + this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRemove.Location = new System.Drawing.Point(232, 160); + this.buttonRemove.Name = "buttonRemove"; + this.buttonRemove.Size = new System.Drawing.Size(56, 24); + this.buttonRemove.TabIndex = 3; + this.buttonRemove.Text = "Remove"; + this.buttonRemove.UseVisualStyleBackColor = true; + this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click); + // + // buttonMoveDown + // + this.buttonMoveDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonMoveDown.Location = new System.Drawing.Point(64, 160); + this.buttonMoveDown.Name = "buttonMoveDown"; + this.buttonMoveDown.Size = new System.Drawing.Size(48, 24); + this.buttonMoveDown.TabIndex = 2; + this.buttonMoveDown.Text = "Down"; + this.buttonMoveDown.UseVisualStyleBackColor = true; + this.buttonMoveDown.Click += new System.EventHandler(this.buttonMoveDown_Click); + // + // buttonMoveUp + // + this.buttonMoveUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonMoveUp.Location = new System.Drawing.Point(8, 160); + this.buttonMoveUp.Name = "buttonMoveUp"; + this.buttonMoveUp.Size = new System.Drawing.Size(48, 24); + this.buttonMoveUp.TabIndex = 1; + this.buttonMoveUp.Text = "Up"; + this.buttonMoveUp.UseVisualStyleBackColor = true; + this.buttonMoveUp.Click += new System.EventHandler(this.buttonMoveUp_Click); + // + // listBoxMacro + // + this.listBoxMacro.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.listBoxMacro.FormattingEnabled = true; + this.listBoxMacro.IntegralHeight = false; + this.listBoxMacro.Location = new System.Drawing.Point(8, 16); + this.listBoxMacro.Name = "listBoxMacro"; + this.listBoxMacro.Size = new System.Drawing.Size(280, 136); + this.listBoxMacro.TabIndex = 0; + this.listBoxMacro.DoubleClick += new System.EventHandler(this.listBoxCommandSequence_DoubleClick); + // + // comboBoxCommands + // + this.comboBoxCommands.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxCommands.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCommands.FormattingEnabled = true; + this.comboBoxCommands.Location = new System.Drawing.Point(8, 16); + this.comboBoxCommands.Name = "comboBoxCommands"; + this.comboBoxCommands.Size = new System.Drawing.Size(232, 21); + this.comboBoxCommands.TabIndex = 0; + // + // buttonAddCommand + // + this.buttonAddCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonAddCommand.Location = new System.Drawing.Point(248, 16); + this.buttonAddCommand.Name = "buttonAddCommand"; + this.buttonAddCommand.Size = new System.Drawing.Size(40, 21); + this.buttonAddCommand.TabIndex = 1; + this.buttonAddCommand.Text = "Add"; + this.buttonAddCommand.UseVisualStyleBackColor = true; + this.buttonAddCommand.Click += new System.EventHandler(this.buttonAddCommand_Click); + // + // groupBoxCommands + // + this.groupBoxCommands.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxCommands.Controls.Add(this.buttonAddCommand); + this.groupBoxCommands.Controls.Add(this.comboBoxCommands); + this.groupBoxCommands.Location = new System.Drawing.Point(8, 240); + this.groupBoxCommands.Name = "groupBoxCommands"; + this.groupBoxCommands.Size = new System.Drawing.Size(296, 48); + this.groupBoxCommands.TabIndex = 3; + this.groupBoxCommands.TabStop = false; + this.groupBoxCommands.Text = "Commands"; + // + // 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(256, 296); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(48, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 296); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(48, 24); + this.buttonTest.TabIndex = 4; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_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(200, 296); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(48, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // MacroEditor + // + 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, 329); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.groupBoxCommands); + this.Controls.Add(this.groupBoxCommandSequence); + this.Controls.Add(this.labelName); + this.Controls.Add(this.textBoxName); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(320, 356); + this.Name = "MacroEditor"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Macro Editor"; + this.Load += new System.EventHandler(this.MacroEditor_Load); + this.groupBoxCommandSequence.ResumeLayout(false); + this.groupBoxCommands.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label labelName; + private System.Windows.Forms.TextBox textBoxName; + private System.Windows.Forms.GroupBox groupBoxCommandSequence; + private System.Windows.Forms.Button buttonRemove; + private System.Windows.Forms.Button buttonMoveDown; + private System.Windows.Forms.Button buttonMoveUp; + private System.Windows.Forms.ListBox listBoxMacro; + private System.Windows.Forms.ComboBox comboBoxCommands; + private System.Windows.Forms.Button buttonAddCommand; + private System.Windows.Forms.GroupBox groupBoxCommands; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonOK; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.cs (rev 0) +++ trunk/plugins/IR Server Suite/Media Center Plugins/Media Center Connection/Forms/MacroEditor.cs 2008-03-25 06:25:01 UTC (rev 1509) @@ -0,0 +1,492 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; + +using IrssUtils; +using IrssUtils.Forms; + +namespace MediaCenterConnection +{ + + partial class MacroEditor : Form + { + + #region Constructor + + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + public MacroEditor() + { + InitializeComponent(); + + textBoxName.Text = "New"; + textBoxName.Enabled = true; + } + + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + /// <param name="name">The name of an existing macro.</param> + public MacroEditor(string name) + : this() + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + textBoxName.Text = name; + textBoxName.Enabled = false; + + string fileName = Path.Combine(Tray.FolderMacros, name + Common.FileExtensionMacro); + ReadFromFile(fileName); + } + + #endregion Constructor + + #region Implementation + + void RefreshCommandList() + { + comboBoxCommands.Items.Clear(); + + comboBoxCommands.Items.Add(Common.UITextRun); + comboBoxCommands.Items.Add(Common.UITextPause); + comboBoxCommands.Items.Add(Common.UITextSerial); + comboBoxCommands.Items.Add(Common.UITextWindowMsg); + comboBoxCommands.Items.Add(Common.UITextTcpMsg); + comboBoxCommands.Items.Add(Common.UITextHttpMsg); + comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextMouse); + comboBoxCommands.Items.Add(Common.UITextEject); + comboBoxCommands.Items.Add(Common.UITextPopup); + comboBoxCommands.Items.Add(Common.UITextGotoScreen); + comboBoxCommands.Items.Add(Common.UITextInputLayer); + //comboBoxCommands.Items.Add(Common.UITextWindowState); + comboBoxCommands.Items.Add(Common.UITextFocus); + comboBoxCommands.Items.Add(Common.UITextExit); + comboBoxCommands.Items.Add(Common.UITextSendMPAction); + comboBoxCommands.Items.Add(Common.UITextSendMPMsg); + comboBoxCommands.Items.Add(Common.UITextStandby); + comboBoxCommands.Items.Add(Common.UITextHibernate); + comboBoxCommands.Items.Add(Common.UITextReboot); + comboBoxCommands.Items.Add(Common.UITextShutdown); + + string[] fileList = Tray.GetFileList(true); + if (fileList != null && fileList.Length > 0) + comboBoxCommands.Items.AddRange(fileList); + } + + /// <summary> + /// Write the macro in the listBox to a macro name provided. + /// </summary> + /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> + void WriteToFile(string fileName) + { + try + { + using (XmlTextWriter writer = new XmlTextWriter(fileName, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.WriteStartDocument(true); + writer.WriteStartElement("macro"); + + foreach (string item in listBoxMacro.Items) + { + writer.WriteStartElement("item"); + writer.WriteAttributeString("command", item); + writer.WriteEndElement(); + } + + writer.WriteEndElement(); + writer.WriteEndDocument(); + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + } + + /// <summary> + /// Read a macro into the listBox from the macro name provided. + /// </summary> + /// <param name="fileName">Name of Macro to read (macro name, not file path).</param> + void ReadFromFile(string fileName) + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(fileName); + + XmlNodeList commandSequence = doc.DocumentElement.SelectNodes("item"); + + listBoxMacro.Items.Clear(); + + foreach (XmlNode item in commandSequence) + listBoxMacro.Items.Add(item.Attributes["command"].Value); + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + } + + private void MacroEditor_Load(object sender, EventArgs e) + { + RefreshCommandList(); + } + + private void buttonAddCommand_Click(object sender, EventArgs e) + { + if (comboBoxCommands.SelectedIndex == -1) + return; + + try + { + string selected = comboBoxCommands.SelectedItem as string; + string newCommand = null; + + if (selected.Equals(Common.UITextRun, StringComparison.OrdinalIgnoreCase)) + { + ExternalProgram externalProgram = new ExternalProgram(); + if (externalProgram.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixRun + externalProgram.CommandString; + } + else if (selected.Equals(Common.UITextPause, StringComparison.OrdinalIgnoreCase)) + { + PauseTime pauseTime = new PauseTime(); + if (pauseTime.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixPause + pauseTime.Time.ToString(); + } + else if (selected.Equals(Common.UITextSerial, StringComparison.OrdinalIgnoreCase)) + { + SerialCommand serialCommand = new SerialCommand(); + if (serialCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixSerial + serialCommand.CommandString; + } + else if (selected.Equals(Common.UITextWindowMsg, StringComparison.OrdinalIgnoreCase)) + { + MessageCommand messageCommand = new MessageCommand(); + if (messageCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixWindowMsg + messageCommand.CommandString; + } + else if (selected.Equals(Common.UITextTcpMsg, StringComparison.OrdinalIgnoreCase)) + { + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString; + } + else if (selected.Equals(Common.UITextHttpMsg, StringComparison.OrdinalIgnoreCase)) + { + HttpMessageCommand httpMessageCommand = new HttpMessageCommand(); + if (httpMessageCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixHttpMsg + httpMessageCommand.CommandString; + } + else if (selected.Equals(Common.UITextKeys, StringComparison.OrdinalIgnoreCase)) + { + KeysCommand keysCommand = new KeysCommand(); + if (keysCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixKeys + keysCommand.CommandString; + } + else if (selected.Equals(Common.UITextMouse, StringComparison.OrdinalIgnoreCase)) + { + MouseCommand mouseCommand = new MouseCommand(); + if (mouseCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixMouse + mouseCommand.CommandString; + } + else if (selected.Equals(Common.UITextEject, StringComparison.OrdinalIgnoreCase)) + { + EjectCommand ejectCommand = new EjectCommand(); + if (ejectCommand.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixEject + ejectCommand.CommandString; + } + else if (selected.Equals(Common.UITextPopup, StringComparison.OrdinalIgnoreCase)) + { + PopupMessage popupMessage = new PopupMessage(); + if (popupMessage.ShowDialog(this) == DialogResult.OK) + newCommand = Common.CmdPrefixPopup + popupMessage.CommandString; + } + /* + else if (selected.Equals(Common.UITextWindowState, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixWindowState; + } + */ + else if (selected.Equals(Common.UITextFocus, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixFocus; + } + else if (selected.Equals(Common.UITextExit, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixExit; + } + else if (selected.Equals(Common.UITextStandby, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixStandby; + } + else if (selected.Equals(Common.UITextHibernate, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixHibernate; + } + else if (selected.Equals(Common.UITextReboot, StringComparison.OrdinalIgnoreCase)) + { + newCommand = Common.CmdPrefixReboot; + } + ... [truncated message content] |
From: <tim...@us...> - 2008-03-25 08:04:12
|
Revision: 1513 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1513&view=rev Author: timmyt81 Date: 2008-03-25 01:04:09 -0700 (Tue, 25 Mar 2008) Log Message: ----------- Added a folder remotely Added Paths: ----------- trunk/plugins/MyContacts/ trunk/plugins/MyContacts/LocalizeStrings.cs trunk/plugins/MyContacts/MyContacts.cs trunk/plugins/MyContacts/MyContacts.csproj trunk/plugins/MyContacts/MyContacts.csproj.user trunk/plugins/MyContacts/MyContacts.dll trunk/plugins/MyContacts/MyContacts.pdb trunk/plugins/MyContacts/MyContacts.sln trunk/plugins/MyContacts/MyContacts.suo trunk/plugins/MyContacts/MyContactsDetail.cs trunk/plugins/MyContacts/RequestResponse.cs trunk/plugins/MyContacts/_template.cs trunk/plugins/MyContacts/mycontacts_structure.xml trunk/plugins/MyContacts/readme.txt trunk/plugins/MyContacts/readme_dev.txt trunk/plugins/MyContacts/release_bluetwo.bat Added: trunk/plugins/MyContacts/LocalizeStrings.cs =================================================================== --- trunk/plugins/MyContacts/LocalizeStrings.cs (rev 0) +++ trunk/plugins/MyContacts/LocalizeStrings.cs 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,266 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Globalization; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Localisation; +using MyContacts.util; + +namespace MyContacts +{ + /// <summary> + /// THIS CLASS IS TAKEN FROM MyWorldMap PLUGIN + /// SOME SMALL CHANGES MADE BY MYSELF. + /// + /// This class will hold all text used in the application + /// The text is loaded for the current language from + /// the file language/[language]/strings.xml + /// </summary> + public class GUILocalizeStrings + { + #region Variables + static LocalisationProvider _stringProvider; + static Dictionary<string, string> _cultures; + static string[] _languages; + #endregion + + #region Constructors/Destructors + // singleton. Dont allow any instance of this class + private GUILocalizeStrings() + { + } + + static public void Dispose() + { + if (_stringProvider != null) + _stringProvider.Dispose(); + } + #endregion + + #region Public Methods + /// <summary> + /// Public method to load the text from a strings/xml file into memory + /// </summary> + /// <param name="strFileName">Contains the filename+path for the string.xml file</param> + /// <returns> + /// true when text is loaded + /// false when it was unable to load the text + /// </returns> + //[Obsolete("This method has changed", true)] + static public bool Load(string language) + { + bool isPrefixEnabled = true; + + using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true); + if (language == null) language = reader.GetValueAsString("skin", "language", "English"); + } + + string directory = Config.GetSubFolder(Config.Dir.Language, "MyContacts"); + string cultureName = null; + if (language != null) cultureName = GetCultureName(language); + + MyLogger.Info("Loading localised Strings - Path: " + directory + " Culture: " + cultureName + " Language: " + language + " Prefix: " + isPrefixEnabled); + + _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); + + GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; + + return true; + } + + static public string CurrentLanguage() + { + if (_stringProvider == null) + Load(null); + + return _stringProvider.CurrentLanguage.EnglishName; + } + + static public void ChangeLanguage(string language) + { + if (_stringProvider == null) + Load(language); + else + _stringProvider.ChangeLanguage(GetCultureName(language)); + } + + /// <summary> + /// Get the translation for a given id and format the sting with + /// the given parameters + /// </summary> + /// <param name="dwCode">id of text</param> + /// <param name="parameters">parameters used in the formating</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode, object[] parameters) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + // if parameters or the translation is null, return the translation. + if ((translation == null) || (parameters == null)) + { + return translation; + } + // return the formatted string. If formatting fails, log the error + // and return the unformatted string. + try + { + return String.Format(translation, parameters); + } + catch (System.FormatException e) + { + MyLogger.Error("Error formatting translation with id " + dwCode); + MyLogger.Error("Unformatted translation: " + translation); + MyLogger.Error(e.ToString()); + return translation; + } + } + + /// <summary> + /// Get the translation for a given id + /// </summary> + /// <param name="dwCode">id of text</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + + if (translation == null) + { + MyLogger.Error("No translation found for id " + dwCode); + return String.Empty; + } + + return translation; + } + + static public void LocalizeLabel(ref string strLabel) + { + if (_stringProvider == null) + Load(null); + + if (strLabel == null) strLabel = String.Empty; + if (strLabel == "-") strLabel = ""; + if (strLabel == "") return; + // This can't be a valid string code if the first character isn't a number. + // This check will save us from catching unnecessary exceptions. + if (!char.IsNumber(strLabel, 0)) + return; + + int dwLabelID; + + try + { + dwLabelID = System.Int32.Parse(strLabel); + } + catch (FormatException e) + { + MyLogger.Error(e.ToString()); + strLabel = String.Empty; + return; + } + + strLabel = _stringProvider.GetString("unmapped", dwLabelID); + if (strLabel == null) + { + MyLogger.Error("No translation found for id " + dwLabelID); + strLabel = String.Empty; + } + } + + public static string LocalSupported() + { + if (_stringProvider == null) + Load(null); + + CultureInfo culture = _stringProvider.GetBestLanguage(); + + return culture.EnglishName; + } + + public static string[] SupportedLanguages() + { + if (_languages == null) + { + if (_stringProvider == null) + Load(null); + + CultureInfo[] cultures = _stringProvider.AvailableLanguages(); + + SortedList sortedLanguages = new SortedList(); + foreach (CultureInfo culture in cultures) + sortedLanguages.Add(culture.EnglishName, culture.EnglishName); + + _languages = new string[sortedLanguages.Count]; + + for (int i = 0; i < sortedLanguages.Count; i++) + { + _languages[i] = (string)sortedLanguages.GetByIndex(i); + } + } + + return _languages; + } + + static public string GetCultureName(string language) + { + if (_cultures == null) + { + _cultures = new Dictionary<string, string>(); + + CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures); + + for (int i = 0; i < cultureList.Length; i++) + { + _cultures.Add(cultureList[i].EnglishName, cultureList[i].Name); + } + } + + if (_cultures.ContainsKey(language)) + return _cultures[language]; + + return null; + } + #endregion + } +} \ No newline at end of file Added: trunk/plugins/MyContacts/MyContacts.cs =================================================================== --- trunk/plugins/MyContacts/MyContacts.cs (rev 0) +++ trunk/plugins/MyContacts/MyContacts.cs 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,510 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MyContacts.database; +using MediaPortal.Util; +using System.Collections.Generic; +using MyContacts.util; + +namespace MyContacts +{ + public class MyContacts : GUIWindow, IComparer<GUIListItem>, ISetupForm + { + #region GUI Components + + [SkinControlAttribute(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUISortButtonControl btnSortBy = null; + //[SkinControlAttribute(4)] + //protected GUIButtonControl btnSync = null; + [SkinControlAttribute(50)] + protected GUIListControl listView = null; + [SkinControlAttribute(51)] + protected GUIThumbnailPanel thumbnailView = null; + + #endregion + + #region Variables + + View _currentView = View.List; + SortMethod _currentSortMethod = SortMethod.LastName; + bool _sortAscending = true; + MyContactsDetail _detail = null; + + #endregion + + #region Constants + + enum SortMethod + { + LastName = 0 + ,FirstName = 1 + ,NickName = 2 + } + + enum View : int + { + List = 0, + SmallIcons = 1, + BigIcons = 2 + } + + public const int WINDOW_ID_LIST = 7677; + public const int WINDOW_ID_DETAIL = 7678; + + #endregion + + public MyContacts() + { + GetID = WINDOW_ID_LIST; + + _detail = new MyContactsDetail(); + + Options opt = new Options(); + Contact cont = new Contact(); + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My Contacts"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "Display your contacts from your Plaxo account"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "TimmyT"; + } + + // show the setup dialog + public void ShowPlugin() + { + gui.Setup frmSetup = new gui.Setup(); + frmSetup.ShowDialog(); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return GetID; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has it's own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of Mediaportal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, + out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = getPluginName(); + strButtonImage = "hover_my contacts.png"; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + #endregion + + #region GUIWindow Members + + public override bool Init() + { + bool ret=Load(GUIGraphicsContext.Skin + @"\mycontacts.xml"); + if (ret) + { + InitMyContacts(); + } + return ret; + } + + protected override void OnPageLoad() + { + GUIWaitCursor.Show(); + base.OnPageLoad(); + LoadList(); + OnSort(); + btnSortBy.SortChanged += new SortEventHandler(SortChanged); + GUIWaitCursor.Hide(); + } + + protected override void OnClicked(int controlId, GUIControl control, + MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == btnViewAs) // view + { + _currentView = (View)btnViewAs.SelectedItem; + ShowThumbPanel(); + GUIControl.FocusControl(GetID, controlId); + } + + if (control == btnSortBy) // sort by + { + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow( + (int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlg.Reset(); + dlg.SetHeading(GUILocalizeStrings.Get(7677004)); + dlg.Add(GUILocalizeStrings.Get(7677001)); + dlg.Add(GUILocalizeStrings.Get(7677002)); + dlg.Add(GUILocalizeStrings.Get(7677003)); + dlg.DoModal(GUIWindowManager.ActiveWindow); + + int selected = dlg.SelectedId - 1; + + _currentSortMethod = (SortMethod)selected; + btnSortBy.Label = dlg.SelectedLabelText; + + OnSort(); + GUIControl.FocusControl(GetID, controlId); + } + + if (control == listView || control == thumbnailView) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null); + OnMessage(msg); + int itemIndex = (int)msg.Param1; + if (actionType == Action.ActionType.ACTION_SELECT_ITEM) + { + OnClick(itemIndex); + } + } + + base.OnClicked(controlId, control, actionType); + } + + public override bool OnMessage(GUIMessage message) + { + return base.OnMessage(message); + } + + #endregion + + void OnClick(int itemIndex) + { + GUIListItem item = GetSelectedItem(); + if (item == null) return; + + Contact c = (Contact)item.MusicTag; + ShowDetails(c); + } + + #region IComparer<GUIListItem> Members + + public int Compare(GUIListItem item1, GUIListItem item2) + { + if (item1 == item2) return 0; + if (item1 == null) return -1; + if (item2 == null) return -1; + + SortMethod method = _currentSortMethod; + bool bAscending = _sortAscending; + + if (bAscending) + { + return String.Compare(item1.Label, item2.Label, true); + } + else + { + return String.Compare(item2.Label, item1.Label, true); + } + return 0; + } + + #endregion + + void SortChanged(object sender, SortEventArgs e) + { + _sortAscending = e.Order != System.Windows.Forms.SortOrder.Descending; + + OnSort(); + UpdateButtons(); + + GUIControl.FocusControl(GetID, ((GUIControl)sender).GetID); + } + + private string getPluginName() + { + Options opt = new Options(); + string name = opt.getValue(Options.PARAM_PLUGINNAME).ToString(); + opt.Dispose(); + return name; + } + + private void InitMyContacts() + { + // nothing to do so far + } + + private void SetLabels() + { + SortMethod method = _currentSortMethod; + + for (int i = 0; i < GetItemCount(); ++i) + { + GUIListItem item = GetItem(i); + Contact contact = (Contact)item.MusicTag; + bool bLastNameSet = contact.LastName.Length > 0; + bool bFirstNameSet = contact.FirstName.Length > 0; + switch (method) + { + case SortMethod.LastName: + { + if (bLastNameSet) + item.Label = contact.LastName; + if (bFirstNameSet) + if (bLastNameSet) + item.Label += " "; + item.Label += contact.FirstName; + if (item.Label.Length<1) + item.Label = contact.ContactIdentifier; + break; + } + case SortMethod.FirstName: + { + if (bFirstNameSet) + item.Label = contact.FirstName; + if (bLastNameSet) + if (bFirstNameSet) + item.Label += " "; + item.Label += contact.LastName; + if (item.Label.Length<1) + item.Label = contact.ContactIdentifier; + break; + } + case SortMethod.NickName: + { + item.Label = contact.NickName; + break; + } + } + } + } + + void OnSort() + { + SetLabels(); + listView.Sort(this); + thumbnailView.Sort(this); + UpdateButtons(); + } + + bool ViewByIcon + { + get + { + if (_currentView != View.List) return true; + return false; + } + } + + bool ViewByLargeIcon + { + get + { + if (_currentView == View.BigIcons) return true; + return false; + } + } + + GUIListItem GetSelectedItem() + { + if (ViewByIcon) + return thumbnailView.SelectedListItem; + else + return listView.SelectedListItem; + } + + GUIListItem GetItem(int itemIndex) + { + if (ViewByIcon) + { + if (itemIndex >= thumbnailView.Count) return null; + return thumbnailView[itemIndex]; + } + else + { + if (itemIndex >= listView.Count) return null; + return listView[itemIndex]; + } + } + + int GetSelectedItemNo() + { + if (ViewByIcon) + return thumbnailView.SelectedListItemIndex; + else + return listView.SelectedListItemIndex; + } + + int GetItemCount() + { + if (ViewByIcon) + return thumbnailView.Count; + else + return listView.Count; + } + + private void UpdateButtons() + { + listView.IsVisible = false; + thumbnailView.IsVisible = false; + + int iControl = listView.GetID; + if (ViewByIcon) + iControl = thumbnailView.GetID; + + GUIControl.ShowControl(GetID, iControl); + GUIControl.FocusControl(GetID, iControl); + + btnSortBy.IsAscending = _sortAscending; + } + + private void ShowThumbPanel() + { + int itemIndex = GetSelectedItemNo(); + thumbnailView.ShowBigIcons(ViewByLargeIcon); + if (itemIndex > -1) + { + GUIControl.SelectItemControl(GetID, listView.GetID, itemIndex); + GUIControl.SelectItemControl(GetID, thumbnailView.GetID, itemIndex); + } + UpdateButtons(); + } + + private string getPicturePath(Contact c) + { + return "DefaultContactsBig.png"; + // the stuff below makes it pretty slow... + //string imgpath = Constants.getThumbsPath() + c.ServerItemID.ToString() + ".jpg"; + //if (!System.IO.File.Exists(imgpath)) + // imgpath= "DefaultContactsBig.png"; + //return imgpath; + } + + private void LoadList() + { + GUIWaitCursor.Show(); + + listView.Clear(); + thumbnailView.Clear(); + int totalItems = 0; + + List<Contact> contacts = Contact.getAllContacts(); + foreach (Contact c in contacts) + { + GUIListItem item = new GUIListItem(); + string name = c.LastName; + if (name.Equals(string.Empty)) + name = c.FirstName; + else if (c.FirstName.Equals(string.Empty)) + name = c.Company; + else + name += ", " + c.FirstName; + item.Label = name; + item.MusicTag = c; + item.IsFolder = false; + item.ThumbnailImage = string.Empty; + if (!c.BusinessPhoto.Equals(string.Empty)) + { + MyLogger.Debug(c.ContactIdentifier + " has photo: " + c.BusinessPhoto); + item.IconImageBig = "http://" + c.BusinessPhoto; + } + else if (!c.PersonalPhoto.Equals(string.Empty)) + { + MyLogger.Debug(c.ContactIdentifier + " has photo: " + c.PersonalPhoto); + item.IconImageBig = "http://" + c.PersonalPhoto; + } + else + item.IconImageBig = getPicturePath(c); + + item.IconImage = "DefaultContacts.png"; + + listView.Add(item); + thumbnailView.Add(item); + totalItems++; + } + //set object count label + GUIPropertyManager.SetProperty("#itemcount", MediaPortal.Util.Utils.GetObjectCountLabel(totalItems)); + + ShowThumbPanel(); + + GUIWaitCursor.Hide(); + } + + private void ShowDetails(Contact c) + { + if (_detail == null) + _detail = new MyContactsDetail(); + + if (GUIWindowManager.GetWindow(_detail.GetID) == null) + { + GUIWindow win = (GUIWindow)_detail; + GUIWindowManager.Add(ref win); + } + + MyContactsDetail detail = (MyContactsDetail)GUIWindowManager.GetWindow(WINDOW_ID_DETAIL); + detail.ContactObj = c; + GUIWindowManager.ActivateWindow(WINDOW_ID_DETAIL); + } + } +} Added: trunk/plugins/MyContacts/MyContacts.csproj =================================================================== --- trunk/plugins/MyContacts/MyContacts.csproj (rev 0) +++ trunk/plugins/MyContacts/MyContacts.csproj 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,123 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MyContacts</RootNamespace> + <AssemblyName>MyContacts</AssemblyName> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\MediaPortal\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Databases, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\MediaPortal\Databases.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Dialogs, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Interop.Phoner, Version=1.0.0.0, Culture=neutral"> + <SpecificVersion>False</SpecificVersion> + <HintPath>lib\Interop.Phoner.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>c:\MediaPortal\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="commands\AddSubCommand.cs" /> + <Compile Include="commands\Command.cs" /> + <Compile Include="commands\CommandBase.cs" /> + <Compile Include="commands\CreateGUIDCommand.cs" /> + <Compile Include="commands\HeaderCommand.cs" /> + <Compile Include="commands\ItemSubCommand.cs" /> + <Compile Include="commands\StatusCommand.cs" /> + <Compile Include="commands\SubCommand.cs" /> + <Compile Include="commands\SyncCommand.cs" /> + <Compile Include="database\Contact.cs" /> + <Compile Include="database\ContactsDatabaseSQLite.cs" /> + <Compile Include="database\DBHandler.cs" /> + <Compile Include="database\Options.cs" /> + <Compile Include="gui\Browser.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="gui\Browser.Designer.cs"> + <DependentUpon>Browser.cs</DependentUpon> + </Compile> + <Compile Include="gui\Setup.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="gui\Setup.Designer.cs"> + <DependentUpon>Setup.cs</DependentUpon> + </Compile> + <Compile Include="LocalizeStrings.cs" /> + <Compile Include="MyContacts.cs" /> + <Compile Include="MyContactsDetail.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RequestResponse.cs" /> + <Compile Include="voip\Phoner.cs" /> + <Compile Include="_template.cs" /> + <Compile Include="util\Constants.cs" /> + <Compile Include="util\MyLogger.cs" /> + <Compile Include="util\Section.cs" /> + <Compile Include="util\Encoding.cs" /> + <Compile Include="util\KeyValues.cs" /> + <Compile Include="util\SectionHandler.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="gui\Browser.resx"> + <DependentUpon>Browser.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="gui\Setup.resx"> + <DependentUpon>Setup.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>Copy "$(TargetPath)" "C:\Mediaportal\plugins\Windows\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MyContacts/MyContacts.csproj.user =================================================================== --- trunk/plugins/MyContacts/MyContacts.csproj.user (rev 0) +++ trunk/plugins/MyContacts/MyContacts.csproj.user 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,5 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectView>ProjectFiles</ProjectView> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MyContacts/MyContacts.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyContacts/MyContacts.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyContacts/MyContacts.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyContacts/MyContacts.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyContacts/MyContacts.sln =================================================================== --- trunk/plugins/MyContacts/MyContacts.sln (rev 0) +++ trunk/plugins/MyContacts/MyContacts.sln 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyContacts", "MyContacts.csproj", "{8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C40816D-4ED4-4F35-BFC5-CBB9CAF2E633}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MyContacts/MyContacts.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyContacts/MyContacts.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyContacts/MyContactsDetail.cs =================================================================== --- trunk/plugins/MyContacts/MyContactsDetail.cs (rev 0) +++ trunk/plugins/MyContacts/MyContactsDetail.cs 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,198 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using MediaPortal.GUI.Library; +using MyContacts.database; +using MyContacts.util; +using MediaPortal.Dialogs; +using System.Collections; +using MyContacts.voip; + +namespace MyContacts +{ + class MyContactsDetail : GUIWindow + { + #region GUI Components + + [SkinControlAttribute(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnCall = null; + [SkinControlAttribute(52)] + protected GUITextControl txtDetail = null; + + #endregion + + #region Variables + + private Contact _contact = new Contact(); + private View _currentView = View.Home; + enum View : int + { + Home = 1, + Business = 2, + Other = 3 + } + private Section[] _sections = SectionHandler.Instance.getAllSections(); + private int _currentSection = 0; + + #endregion + + public MyContactsDetail() + { + GetID = MyContacts.WINDOW_ID_DETAIL; + Init(); + } + + public Contact ContactObj + { + get { return _contact; } + set { _contact = value; } + } + + private void ShowDetails() + { + string contactDetails = _sections[_currentSection].display(ContactObj); + txtDetail.Label = contactDetails; + } + + #region GUIWindow Members + + public override bool Init() + { + MyLogger.Debug("MyContactsDetail Init()"); + return Load(GUIGraphicsContext.Skin + @"\mycontactsdetail.xml"); + } + + protected override void OnPageLoad() + { + btnViewAs.Label = _sections[_currentSection].Name; + ShowDetails(); + base.OnPageLoad(); + } + + private void Call(string number) + { + //GUIWindowSkype skype = (GUIWindowSkype)GUIWindowManager.GetWindow(109144); + //GUIWindowManager.ActivateWindow(109144); + //skype.CallContact(contactToCall); + + //GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow( + // (int)GUIWindow.Window.WINDOW_DIALOG_OK); + //dlg.SetHeading("Calling..."); + //dlg.SetLine(1, "You are calling " + contactToCall); + //dlg.SetLine(2, "(in future)"); + //dlg.SetLine(3, String.Empty); + //dlg.DoModal(GUIWindowManager.ActiveWindow); + + MyPhoner phoner = new MyPhoner(); + phoner.Call(number); + } + + + protected override void OnClicked(int controlId, GUIControl control, + MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == btnViewAs) // view + { + if (_currentSection < (_sections.Length - 1)) + _currentSection++; + else + _currentSection = 0; + + btnViewAs.Label = _sections[_currentSection].Name; + + _currentView = (View)(btnViewAs.SelectedItem + 1); + GUIControl.FocusControl(GetID, controlId); + } + if (control == btnCall) // call + { + //string link = "callto://" + ContactObj.SkypeID; + //MyLogger.Info("callto = " + link); + //System.Diagnostics.Process.Start(link); + + //System.Net.WebRequest req = System.Net.WebRequest.Create(link); + //req.GetResponse(); + + KeyValues phone_numbers = new KeyValues(); + if (ContactObj.AssistantPhone.Length > 0) + phone_numbers.Add(Contact.F_AssistantPhone, ContactObj.AssistantPhone); + if (ContactObj.BusinessMobilePhone.Length > 0) + phone_numbers.Add(Contact.F_BusinessMobilePhone, ContactObj.BusinessMobilePhone); + if (ContactObj.HomePhone.Length > 0) + phone_numbers.Add(Contact.F_HomePhone, ContactObj.HomePhone); + if (ContactObj.HomePhone2.Length > 0) + phone_numbers.Add(Contact.F_HomePhone2, ContactObj.HomePhone2); + if (ContactObj.OtherPhone.Length > 0) + phone_numbers.Add(Contact.F_OtherPhone, ContactObj.OtherPhone); + if (ContactObj.PersonalMobilePhone.Length > 0) + phone_numbers.Add(Contact.F_PersonalMobilePhone, ContactObj.PersonalMobilePhone); + if (ContactObj.WorkPhone.Length > 0) + phone_numbers.Add(Contact.F_WorkPhone, ContactObj.WorkPhone); + if (ContactObj.WorkPhone2.Length > 0) + phone_numbers.Add(Contact.F_WorkPhone2, ContactObj.WorkPhone2); + + GUIDialogMenu dlg1 = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlg1.Reset(); + dlg1.SetHeading("Select number to call"); //TODO i18n + IEnumerator en = phone_numbers.getEnumerator(); + while (en.MoveNext()) + { + DictionaryEntry entry = (DictionaryEntry)en.Current; + dlg1.Add(entry.Key + ": " + entry.Value); + } + dlg1.DoModal(GetID); + + DictionaryEntry selected_entry = (DictionaryEntry)phone_numbers.Collection[dlg1.SelectedId-1]; + + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow( + (int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading("Info"); + dlg.SetLine(1, "You are calling " + selected_entry.Value); + dlg.DoModal(GUIWindowManager.ActiveWindow); + + Call(selected_entry.Value.ToString()); + } + ShowDetails(); + base.OnClicked(controlId, control, actionType); + } + + public override bool OnMessage(GUIMessage message) + { + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + base.OnMessage(message); + break; + + } + return base.OnMessage(message); + } + #endregion + } +} Added: trunk/plugins/MyContacts/RequestResponse.cs =================================================================== --- trunk/plugins/MyContacts/RequestResponse.cs (rev 0) +++ trunk/plugins/MyContacts/RequestResponse.cs 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,160 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using MyContacts.database; +using System.Net; +using System.IO; +using MyContacts.commands; + +namespace MyContacts +{ + class RequestResponse + { + public const string NEWLINE = "%0a"; + + private RequestResponse() { } + + /// <summary> + /// removes any newline ("%0a") chunks from the start and the end of the given string + /// </summary> + /// <param name="response"></param> + /// <returns></returns> + public static string TrimNewLine(string response) + { + if (response.StartsWith(NEWLINE)) + response = response.Substring(NEWLINE.Length); + if (response.EndsWith(NEWLINE)) + response = response.Substring(0, response.Length - NEWLINE.Length); + return response; + } + + public static string URL + { + get + { + Options opt = new Options(); + string ret = (string)opt.getValue(Options.PARAM_URL); + opt.Dispose(); + return ret; + } + set + { + Options opt = new Options(); + opt.insertOrUpdate(Options.PARAM_URL, value); + opt.Dispose(); + } + } + + public static string sendRequest(string url) + { + WebResponse response = null; + Stream stream = null; + StreamReader reader = null; + + try + { + MediaPortal.GUI.Library.Log.Debug("MyContacts: send Request(" + url + ")"); + + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + + response = request.GetResponse(); + stream = response.GetResponseStream(); + + if (!response.ContentType.ToLower().StartsWith("text/")) + return null; + + string buffer = "", line; + + reader = new StreamReader(stream); + + while ((line = reader.ReadLine()) != null) + { + buffer += line + "\r\n"; + } + + return buffer; + } + catch (WebException e) + { + MediaPortal.GUI.Library.Log.Debug("MyContacts: Can't download:" + e); + return null; + } + catch (IOException e) + { + MediaPortal.GUI.Library.Log.Debug("MyContacts: Can't download:" + e); + return null; + } + finally + { + if (reader != null) + reader.Close(); + + if (stream != null) + stream.Close(); + + if (response != null) + response.Close(); + } + } + + public static string handleResponse(string response) + { + MediaPortal.GUI.Library.Log.Debug("MyContacts: handle response (" + response + ")"); + + string ret = string.Empty; // status message + + response = response.Replace("\r\n", "%0a"); + + /* handle the response header */ + HeaderCommand header = new HeaderCommand(); + header.HandleResponse(ref response); + + /* handle the response status */ + StatusCommand status = new StatusCommand(); + status.HandleResponse(ref response); + if (status.ErrorCode >= 300) + { + ret = status.ErrorMessage; + } + + /* handle the response sync */ + SyncCommand sync = new SyncCommand(); + if (response.Contains(sync.StartTag())) + { + sync.HandleResponse(ref response); + + int recordcount = 0; + foreach (SubCommand sc in sync.SubCommands) + recordcount += sc.Status; + ret = recordcount + " contacts added!"; + } + + return ret; + } + } +} Added: trunk/plugins/MyContacts/_template.cs =================================================================== --- trunk/plugins/MyContacts/_template.cs (rev 0) +++ trunk/plugins/MyContacts/_template.cs 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,79 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; + +/// <summary> +/// Summary description for Class1 +/// </summary> +public class Class1 +{ + #region Imports + #endregion + + #region Enums + #endregion + + #region Delegates + #endregion + + #region Events + #endregion + + #region Variables + // Private Variables + // Protected Variables + // Public Variables + #endregion + + #region Constructors/Destructors + + public Class1() + { + + } + + #endregion + + #region Properties + // Public Properties + #endregion + + #region Public Methods + #endregion + + #region Private Methods + #endregion + + #region <Base class> Overloads + #endregion + + #region <Interface> Implementations + // region for each interface + #endregion + + + +} Added: trunk/plugins/MyContacts/mycontacts_structure.xml =================================================================== --- trunk/plugins/MyContacts/mycontacts_structure.xml (rev 0) +++ trunk/plugins/MyContacts/mycontacts_structure.xml 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8" ?> +<MyContacts> + <settings> + <field name="bullet">- </field> + <field name="tab"> </field> + <field name="seperator">* * * * *</field> + </settings> + <section id="1" name="Privat"> + <line>[FirstName] [LastName]</line> + <line>[HomeAddress]</line> + <line>[HomeAddress2]</line> + <line>[HomeAddress3]</line> + <line>[HomeZipCode] [HomeCity][tab][HomeCountry]</line> + <line>[seperator]</line> + <line>Telefon:</line> + <line>[bullet]privat:[tab][HomePhone]</line> + <line>[bullet]mobil:[tab][BusinessMobilePhone]</line> + <line>[seperator]</line> + <line>Email:</line> + <line>[bullet][BusinessEmail]</line> + <line>[bullet][BusinessEmail2]</line> + <line>[bullet][BusinessEmail3]</line> + <line>[bullet][PersonalEmail]</line> + <line>[bullet][PersonalEmail2]</line> + <line>[bullet][PersonalEmail3]</line> + <line>[seperator]</line> + <line>Skype:[tab][SkypeID]</line> + <line>URL:[tab][PersonalWebPage]</line> + </section> + <section id="2" name="Geschäftlich"> + <line>[FirstName] [LastName]</line> + <line>[JobTitle]</line> + <line>[seperator]</line> + <line>[Company]</line> + <line>[WorkAddress]</line> + <line>[WorkAddress2]</line> + <line>[WorkAddress3]</line> + <line>[WorkZipCode] [WorkCity][tab][WorkCountry]</line> + <line>[seperator]</line> + <line>Telefon:</line> + <line>[bullet][WorkPhone]</line> + <line>[bullet][WorkPhone2]</line> + <line>Fax:</line> + <line>[bullet][WorkFax]</line> + <line>[seperator]</line> + <line>Email:</line> + <line>[bullet][BusinessEmail]</line> + <line>[bullet][BusinessEmail2]</line> + <line>[bullet][BusinessEmail3]</line> + <line>[bullet][PersonalEmail]</line> + <line>[bullet][PersonalEmail2]</line> + <line>[bullet][PersonalEmail3]</line> + <line>[bullet][seperator]</line> + <line>URL:[tab][BusinessWebPage]</line> + </section> + <section id="3" name="Weitere"> + <line>Nickname:[tab][NickName]</line> + <line>Birthday:[tab][Birthday]</line> + <line>[seperator]</line> + <line>Notes:</line> + <line>[Notes]</line> + </section> +</MyContacts> \ No newline at end of file Added: trunk/plugins/MyContacts/readme.txt =================================================================== --- trunk/plugins/MyContacts/readme.txt (rev 0) +++ trunk/plugins/MyContacts/readme.txt 2008-03-25 08:04:09 UTC (rev 1513) @@ -0,0 +1,182 @@ +******************************************************************************** +* * +* Plugin Name: My Contacts * +* Author: TimmyT (htp...@gm...) * +* Version: 0.2.0 * +* Build Date: 2008-03-14 * +* Plugin URL: http://dev.thomasblank.ch/mediaportal/my-contacts-plugin/ * +* * +* Summary: Display your contacts in MediaPortal without having to * +* reenter them manually. Just keep your address book in Plaxo * +* [www.plaxo.com] up-to-date and easily sync your contacts * +* to your MediaPortal. * +* * +******************************************************************************** + + +Description +*********** +A couple of months ago, I started to work on an address book plugin. My goal +was to easily import a variety of existing address books (MS Outlook, +Thunderbird and so on) and display the addresses in MediaPortal. I am a happy +Plaxo! user for some years now and when I found out that Plaxo offers an API, +I decided to create a MediaPortal plugin that synchronizes with a Plaxo account. + +For those of you who have no clou what Plaxo is (I suppose there are some), +Plaxo is a webservice that allows you to share data between different +application and services, such as Microsoft Outlook, Mozilla Thunderbird, Apple +Address Book and many more. Your information are mirrored on a Plaxo server and +all your application can access these information there. For example, I use +Outlook at my office and at home. Thanks to Plaxo, I always have my contacts, +my tasks and my notes synchronized between the two computers. + +Now back to my plugin... Obviously, you need the get a Plaxo account. Check out +the Plaxo website (http://www.plaxo.com) to find out if your favorite PIM +application is supported. If yes, great! You just need to download the +according tool and sync! Minutes later, all your infos are available in your +Plaxo account. If your favorite PIM is not supported - bad luck :-( You could +still use my plugin but you’d have to enter all your addresses through the +webfrontend of plaxo. + +Now when you do have all your contacts in your Plaxo account, you’re ready to +start with this plugin. Simply donwload and install the plugin and go to +configuration to set up your account. + +One more thing to say. Even though I talk about "synchronisation", it’s +actually just a one-way process. Everytime a sync is performed, the local +database will be deleted and all your contacts will be reimported. And for now, +this process is done manually through the configuration form only. Maybe in +future, this procedure can be triggered from within the mediaportal gui or do +even automatic syncs, but hey, this is just the first release... leave me some +room for improvement here ;-) + + +Installation +************ +- Just unpack the zip file and copy the folders "skin" and "plugins" to your + MediaPortal root directoy (c:\program files\team mediaportal\mediaportal) +- Start MediaPortal configuration and activate the plugin +- Enter the configuration for this plugin (details see below) + + +Configuration +************* +In the configuration form, enter your Plaxo username (email-address) and your +password. Press save and hit the sync button. Depending on the number of +contacts, this process takes a while, sometimes up to a minute, so be +patient ;-). You can also change the name of the plugin. + +After a successful sync, you can browse your contacts from within the +configuration form. Simple hit the "browse contacts" button and a very +rudimental form shows your contacts. You can delete some contacts if you wish to +(delete is just local, it won’t affect your contacts at Plaxo). Also you can see +the field names of your contact details. For example, the "Mobile Phone" field +in outlook is available in the "BusinessMobilePhone" field in Plaxo. You’ll +probably need the field names if you personalize your views (see below). + + +Release Notes +************* +v 0.2.0 (2008-03-14) +- first release + + +More details below... + + + +Configuration part II +********************* +The second part you can configure are the different views. Open the xml-file +"plugins\Windows\MyContacts\mycontacts_structure.xml" and you’ll see a +structure like this: + +<?xml version="1.0" encoding="utf-8" ?> +<MyContacts> +<settings> +<field name="bullet">- </field> +<field name="tab"> </field> +<field name="seperator">* * * * *</field> +</settings> + +<section id="1" name="Home"> +<line>[FirstName] [LastName]</line> +<line>[HomeAddress]</line> +<line>[HomeAddress2]</line> +<line>[HomeAddress3]</line> +<line>[HomeZipCode] [HomeCity][tab][HomeCountry]</line> +<line>[seperator]</line> +<line>Phone:</line> +<line>[bullet]private:[tab][HomePhone]</line> +<line>[bullet]mobile:[tab][BusinessMobilePhone]</line> +<line>Email:</line> +<line>[bullet][PersonalEmail]</line> +<line>[seperator]</line> +<line>Skype:[tab][SkypeID]</line> +<line>URL:[tab][PersonalWebPage]</line> +</section> + +<section id="2" name="Business"> +<line>[FirstName] [LastName]</line> +<line>[JobTitle]</line> +<line>[seperator]</line> +<line>[Company]</line> +<line>[WorkAddress]</line> +<line>[WorkAddress2]</line> +<line>[WorkAddress3]</line> +<line>[WorkZipCode] [WorkCity][tab][WorkCountry]</line> +<line>[seperator]</line> +<line>Telefon:</line> +<line>[bullet][WorkPhone]</line> +<line>[bullet][WorkPhone2]</line> +<line>Fax:</line> +<line>[bullet][WorkFax]</line> +<line>[seperator]</line> +<line>Email:</line> +<line>[bullet][BusinessEmail]</line> +<line>[bullet][seperator]</line> +<line>URL:[tab][BusinessWebPage]</line> +</section> + +<section id="3" name="Other"> +<line>Nickname:[tab][NickName]</line> +<line>Birthday:[tab][Birthday]</line> +<line>[seperator]</line> +<line>Notes:</line> +<line>[Notes]</line> +</section> +</MyContacts> + +As you can see, there are three different sections defined (you don’t have to +stick to this, you can define just two or even 6 sections - up to you). All +information that you define in one section are diplayed in a seperate window. +There are three settings (bullet, tab, seperator) that you can assign a +personalized value to. All fields must be in square brackets []. The name of the +sections (here Home, Business and Other) are variable and can be renamed. +They’re displayed in MediaPortal as labels of the switch buttons. + + +Photos +****** +Maybe you’ll notice that some of your contacts have photos (in thumbnail view), +but most of them probably don’t. Plaxo only shows photos of your contacts which +are Plaxo members themself. Unfortunately Plaxo doesn’t allow you to manually +assign photos to your contacts. So right now, the only way to get photos of +everybody is to persuade them to become a Plaxo member. + + +Known bugs +********** +Once you’ve entered your username/password in configuration form and hit the +button “save”, you cannot alter them anymore. You’ll have to hit “clear” first +and re-enter the values. + + +Limitations +*********** +Maybe you have more than one contact folder in P... [truncated message content] |
From: <wie...@us...> - 2008-03-25 21:21:45
|
Revision: 1526 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1526&view=rev Author: wiesener Date: 2008-03-25 14:21:38 -0700 (Tue, 25 Mar 2008) Log Message: ----------- Initial commit. Added an option to use the g_player instead of PlayListPlayer in order to get OSD, but this doesn't work too well. Added Paths: ----------- trunk/plugins/NRK Browser/ trunk/plugins/NRK Browser/Nrk.cs trunk/plugins/NRK Browser/NrkBrowser.csproj trunk/plugins/NRK Browser/NrkBrowser.sln trunk/plugins/NRK Browser/NrkBrowser.xml trunk/plugins/NRK Browser/NrkPlugin.cs trunk/plugins/NRK Browser/Properties/ trunk/plugins/NRK Browser/Properties/AssemblyInfo.cs trunk/plugins/NRK Browser/SettingsForm.Designer.cs trunk/plugins/NRK Browser/SettingsForm.cs trunk/plugins/NRK Browser/SettingsForm.resx trunk/plugins/NRK Browser/readme.txt Added: trunk/plugins/NRK Browser/Nrk.cs =================================================================== --- trunk/plugins/NRK Browser/Nrk.cs (rev 0) +++ trunk/plugins/NRK Browser/Nrk.cs 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2008 Terje Wiesener <wie...@sa...> + * + * Loosely based on an anonymous (and slightly outdated) NRK parser in python for Myth-tv, + * please email me if you are the author :) + * + * */ + +using System.Collections.Generic; +using System.Text.RegularExpressions; +using System.Net; +using System.IO; +using System.Text; + +namespace Nrk +{ + #region Helper Classes + + public abstract class Item + { + private string _id; + private string _title; + + public string Title + { + get { return _title; } + } + + public string ID + { + get { return _id; } + } + + public virtual bool Playable + { + get { return false; } + } + + public override string ToString() + { + return "(" + this.GetType().Name + ") " + this.Title; + } + + public Item(string id, string title) + { + _id = id; + _title = title; + } + } + + public class Category : Item + { + public Category(string id, string title) : base(id, title) { } + } + + public class Program : Item + { + public Program(string id, string title) : base(id, title) { } + } + + public class Folder : Item + { + public Folder(string id, string title) : base(id, title) { } + } + + public class Clip : Item + { + public Clip(string id, string title) : base(id, title) { } + + public override bool Playable + { + get { return true; } + } + } + + #endregion + + public class NrkParser + { + static string BASE_URL = "http://www1.nrk.no/"; + static string MAIN_URL = BASE_URL + "nett-tv/"; + static string CATEGORY_URL = MAIN_URL + "tema/"; + static string PROGRAM_URL = MAIN_URL + "prosjekt/"; + static string SETTINGS_URL = MAIN_URL + "innstillinger/"; + static string CLIP_URL = MAIN_URL + "klipp/"; + static string FOLDER_URL = MAIN_URL + "kategori/"; + + CookieContainer _jar; + int _speed; + + public NrkParser(int speed) + { + _jar = new CookieContainer(); + this.Speed = speed; + } + + public int Speed + { + get { return _speed; } + set + { + _speed = value; + FetchUrl(NrkParser.MAIN_URL + "hastighet.aspx?hastighet=" + _speed + "&retururl=http://www1.nrk.no/nett-tv/"); + } + } + + public List<Item> GetCategories() + { + List<Item> categories = new List<Item>(); + string data = FetchUrl(NrkParser.MAIN_URL); + Regex query = new Regex("<a href=\"/nett-tv/tema/(\\w*).*?>(.*?)</a>"); + MatchCollection result = query.Matches(data); + foreach (Match x in result) + { + if (x.Groups[2].Value != "Plusspakken") + { + categories.Add(new Category(x.Groups[1].Value, x.Groups[2].Value)); + } + } + return categories; + } + + public List<Item> GetPrograms(Category category) + { + string data = FetchUrl(NrkParser.CATEGORY_URL + category.ID); + Regex query = new Regex("<a href=\"/nett-tv/prosjekt/(.*?)\" id=\".*?\" title=\"(.*?)\".*?>\\s+<img src=\"(.*?)\" id="); + MatchCollection matches = query.Matches(data); + List<Item> programs = new List<Item>(); + foreach (Match x in matches) + { + programs.Add(new Program(x.Groups[1].Value, x.Groups[2].Value)); + } + return programs; + } + + public List<Item> GetAllPrograms()//all programs + { + string data = FetchUrl(NrkParser.MAIN_URL + "bokstav/@"); + Regex query = new Regex("<a href=\"/nett-tv/prosjekt/(.*?)\" id=\".*?\" title=\"(.*?)\".*?>\\s+<img src=\"(.*?)\" id="); + MatchCollection matches = query.Matches(data); + List<Item> programs = new List<Item>(); + foreach (Match x in matches) + { + programs.Add(new Program(x.Groups[1].Value, x.Groups[2].Value)); + } + return programs; + } + + public List<Item> GetFolders(Program program) + { + string data = FetchUrl(NrkParser.PROGRAM_URL + program.ID); + Regex query = new Regex("<a id=\".*?\" href=\"/nett-tv/kategori/(.*?)\".*?title=\"(.*?)\".*?class=\"icon-(.*?)-black\".*?>(.*?)</a>"); + MatchCollection matches = query.Matches(data); + List<Item> folders = new List<Item>(); + foreach (Match x in matches) + { + folders.Add(new Folder(x.Groups[1].Value, x.Groups[2].Value)); + } + return folders; + } + + public List<Item> GetFolders(Folder folder) + { + string data = FetchUrl(NrkParser.FOLDER_URL + folder.ID); + Regex query = new Regex("<a id=\".*?\" href=\"/nett-tv/kategori/(.*?)\".*?title=\"(.*?)\".*?class=\"icon-(.*?)-black\".*?>(.*?)</a>"); + MatchCollection matches = query.Matches(data); + List<Item> folders = new List<Item>(); + foreach (Match x in matches) + { + folders.Add(new Folder(x.Groups[1].Value, x.Groups[2].Value)); + } + return folders; + } + + public List<Item> GetClips(Program program) + { + string data = FetchUrl(NrkParser.PROGRAM_URL + program.ID); + List<Item> clips = new List<Item>(); + Regex query = new Regex("<a href=\"/nett-tv/klipp/(.*?)\"\\s+title=\"(.*?)\"\\s+class=\"(.*?)\".*?>(.*?)</a>"); + MatchCollection matches = query.Matches(data); + foreach (Match x in matches) + { + clips.Add(new Clip(x.Groups[1].Value, x.Groups[4].Value)); + } + + return clips; + } + + public List<Item> GetClips(Folder folder) + { + string data = FetchUrl(NrkParser.FOLDER_URL + folder.ID); + + List<Item> clips = new List<Item>(); + + Regex query = new Regex("<a href=\"/nett-tv/klipp/(.*?)\"\\s+title=\"(.*?)\"\\s+class=\"(.*?)\".*?>(.*?)</a>"); + MatchCollection matches = query.Matches(data); + foreach (Match x in matches) + { + clips.Add(new Clip(x.Groups[1].Value, x.Groups[4].Value)); + } + + return clips; + } + + public string GetClipUrl(Clip clip) + { + string data = FetchUrl(NrkParser.CLIP_URL + clip.ID); + Regex query = new Regex("<param name=\"FileName\" value=\"(.*?)\" />", RegexOptions.IgnoreCase); + MatchCollection result = query.Matches(data); + string urldata = FetchUrl(result[0].Groups[1].Value); + query = new Regex("<ref href=\"(.*?)\" />"); + MatchCollection movie_url = query.Matches(urldata); + //skip any advertisement + try { return movie_url[1].Groups[0].Value; } + catch { return movie_url[0].Groups[1].Value; } + } + + string FetchUrl(string url) + { + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"; + request.CookieContainer = _jar; + // Set some reasonable limits on resources used by this request + request.MaximumAutomaticRedirections = 4; + request.MaximumResponseHeadersLength = 4; + // Set credentials to use for this request. + request.Credentials = CredentialCache.DefaultCredentials; + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + + // Get the stream associated with the response. + Stream receiveStream = response.GetResponseStream(); + + // Pipes the stream to a higher level stream reader with the required encoding format. + StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8); + + string ret = readStream.ReadToEnd(); + response.Close(); + readStream.Close(); + return ret; + } + + /* Test function. + * Will simply call the different functions and print out the result + */ + public static void Main() + { + NrkParser nrk = new NrkParser(900); + + List<Item> categories = nrk.GetCategories(); + foreach (Item category in categories) + { + System.Console.WriteLine(category.ID + " " + category.Title); + } + System.Console.WriteLine(); + + List<Item> programs = nrk.GetPrograms((Category)categories[1]); + foreach (Program program in programs) + { + System.Console.WriteLine(program.ID + " " + program.Title); + } + System.Console.WriteLine(); + + List<Item> clips = nrk.GetClips((Program)programs[0]);//list episodes + foreach (Clip clip in clips) + { + System.Console.WriteLine(clip.ID + " " + clip.Title); + } + System.Console.WriteLine(); + + List<Item> folders = nrk.GetFolders((Program)programs[0]);//list folders (ie. 2006, january etc) + foreach (Folder folder in folders) + { + System.Console.WriteLine(folder.ID + " " + folder.Title); + } + System.Console.WriteLine(); + + clips = nrk.GetClips((Folder)folders[1]);//list episodes + foreach (Clip clip in clips) + { + System.Console.WriteLine(clip.ID + " " + clip.Title); + } + System.Console.WriteLine(); + + string url = nrk.GetClipUrl((Clip)clips[0]); + System.Console.WriteLine(url); + + programs = nrk.GetAllPrograms();//alphabetical list + foreach (Program program in programs) + { + System.Console.WriteLine(program.ID + " " + program.Title); + } + System.Console.WriteLine(); + + System.Console.WriteLine("Press enter to quit"); + System.Console.Read(); + } + } + +} \ No newline at end of file Added: trunk/plugins/NRK Browser/NrkBrowser.csproj =================================================================== --- trunk/plugins/NRK Browser/NrkBrowser.csproj (rev 0) +++ trunk/plugins/NRK Browser/NrkBrowser.csproj 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NrkBrowser</RootNamespace> + <AssemblyName>NrkBrowser</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\debug\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="Nrk.cs" /> + <Compile Include="NrkPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SettingsForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="SettingsForm.Designer.cs"> + <DependentUpon>SettingsForm.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <Content Include="NrkBrowser.xml" /> + <Content Include="readme.txt" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="SettingsForm.resx"> + <DependentUpon>SettingsForm.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "$(TargetPath)" "C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/NRK Browser/NrkBrowser.sln =================================================================== --- trunk/plugins/NRK Browser/NrkBrowser.sln (rev 0) +++ trunk/plugins/NRK Browser/NrkBrowser.sln 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NrkBrowser", "NrkBrowser.csproj", "{DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DEE2E577-EF83-4FD3-9C3C-360CD3ACB125}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/NRK Browser/NrkBrowser.xml =================================================================== --- trunk/plugins/NRK Browser/NrkBrowser.xml (rev 0) +++ trunk/plugins/NRK Browser/NrkBrowser.xml 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,15 @@ +<window> + + <define>#header.label:NRK Nett-TV</define> + + <id>40918376</id> + <defaultcontrol>50</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <import>common.window.xml</import> + + <!-- importing the default video facade view, with id 50 --> + <import>common.facade.video.xml</import> + + </controls> +</window> \ No newline at end of file Added: trunk/plugins/NRK Browser/NrkPlugin.cs =================================================================== --- trunk/plugins/NRK Browser/NrkPlugin.cs (rev 0) +++ trunk/plugins/NRK Browser/NrkPlugin.cs 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2008 Terje Wiesener <wie...@sa...> + * + * */ +using System; +using System.Collections.Generic; +using System.Text; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Playlists; +using MediaPortal.Profile; + +using Nrk; +using System.Windows.Forms; + + +namespace NrkBrowser +{ + public class NrkPlugin : GUIWindow, ISetupForm + { + + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeView = null; + + protected NrkParser _nrk = null; + protected Stack<Item> _active = null; + protected bool _osdPlayer = true; + + static string configfile = "NrkBrowserSettings.xml"; + + public NrkPlugin() + { + GetID = 40918376; + } + + #region ISetupForm Members + + public string PluginName() + { + return "NRK browser"; + } + + public string Description() + { + return "Plugin for watching NRK nett-tv"; + } + + public string Author() + { + return "Terje Wiesener <wie...@sa...>"; + } + + public void ShowPlugin() + { + SettingsForm form = new SettingsForm(); + Settings settings = new Settings(NrkPlugin.configfile); + int speed = settings.GetValueAsInt("NrkBrowser", "speed", 2048); + if (speed < form.speedUpDown.Minimum) + { + speed = (int)form.speedUpDown.Minimum; + settings.SetValue("NrkBrowser", "speed", speed); + } + if (speed > form.speedUpDown.Maximum) + { + speed = (int)form.speedUpDown.Maximum; + settings.SetValue("NrkBrowser", "speed", speed); + } + form.speedUpDown.Value = speed; + + bool osd = settings.GetValueAsBool("NrkBrowser", "osdPlayer", false); + form.osdPlayerCheckbox.Checked = osd; + + DialogResult res = form.ShowDialog(); + if (res == DialogResult.OK) + { + speed = (int)form.speedUpDown.Value; + settings.SetValue("NrkBrowser", "speed", speed); + osd = form.osdPlayerCheckbox.Checked; + settings.SetValueAsBool("NrkBrowser", "osdPlayer", osd); + } + } + + public bool CanEnable() + { + return true; + } + + public int GetWindowId() + { + return GetID; + //return 40918376; + } + + public bool DefaultEnabled() + { + return true; + } + + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of Mediaportal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, + out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = GUIGraphicsContext.Skin + @"\media\hover_webbrowser.png"; + return true; + } + + #endregion + + + public override bool Init() + { + bool result = Load(GUIGraphicsContext.Skin + @"\NrkBrowser.xml"); + Settings settings = new Settings(NrkPlugin.configfile); + int speed = settings.GetValueAsInt("NrkBrowser", "speed", 2048); + _nrk = new NrkParser(speed); + _active = new Stack<Item>(); + _osdPlayer = settings.GetValueAsBool("NrkBrowser", "osdPlayer", false); + return result; + } + + protected override void OnPageLoad() + { + if (_active.Count == 0) + { + Activate(null); + } + else + { + Activate(_active.Pop()); + } + } + + protected override void OnPreviousWindow() + { + if (_active.Count <= 0) + { + base.OnPreviousWindow(); + return; + } + _active.Pop();//we do not want to show the active item again + if (_active.Count > 0) Activate(_active.Pop()); + else Activate(null); + } + + protected override void OnClicked(int controlId, GUIControl control, + MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == facadeView) ItemSelected(); + base.OnClicked(controlId, control, actionType); + } + + protected void UpdateList(List<Item> newitems) + { + this.facadeView.Clear(); + foreach (Item item in newitems) + { + GUIListItem listitem = new GUIListItem(item.Title); + listitem.TVTag = item; + if (item.Playable) + { + listitem.IconImage = GUIGraphicsContext.Skin + @"\media\defaultVideo.png"; + listitem.IconImageBig = GUIGraphicsContext.Skin + @"\media\defaultVideo.png"; + } + else + { + listitem.IconImage = GUIGraphicsContext.Skin + @"\media\defaultFolder.png"; + listitem.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; + } + this.facadeView.Add(listitem); + } + + } + + protected void ItemSelected() + { + Item selecteditem = (Item)facadeView.SelectedListItem.TVTag; + Activate(selecteditem); + } + + protected void Activate(Item item) + { + if (item == null) + { + List<Item> items = _nrk.GetCategories(); + UpdateList(items); + return; + } + + if (item is Clip) + { + PlayClip((Clip)item); + return; + } + + _active.Push(item); + + if (item is Category) + { + UpdateList(_nrk.GetPrograms((Category)item)); + } + if (item is Program) + { + List<Item> items = _nrk.GetClips((Program)item); + items.AddRange(_nrk.GetFolders((Program)item)); + UpdateList(items); + } + if (item is Folder) + { + List<Item> items = _nrk.GetClips((Folder)item); + items.AddRange(_nrk.GetFolders((Folder)item)); + UpdateList(items); + } + } + + protected void PlayClip(Clip item) + { + string url = _nrk.GetClipUrl(item); + PlayListType type; + if (url.EndsWith(".wmv")) type = PlayListType.PLAYLIST_VIDEO_TEMP; + else if (url.EndsWith(".wma")) type = PlayListType.PLAYLIST_RADIO_STREAMS; + //FIXME: Hangs on some audio streams... + else + { + MessageBox.Show("Unknown clip type, please contact author"); + return; + } + + if (_osdPlayer) + { + //FIXME: the g_player doesn't seem to play any of the streams. + //Could it be that it doesn't like the mms:// url? + g_Player.Init(); + if (type == PlayListType.PLAYLIST_VIDEO_TEMP) + g_Player.PlayVideoStream(url, item.Title); + else + g_Player.PlayAudioStream(url, false); + } + else + { + PlayListPlayer playlistPlayer = PlayListPlayer.SingletonPlayer; + playlistPlayer.RepeatPlaylist = false; + PlayList playlist = playlistPlayer.GetPlaylist(type); + playlist.Clear(); + PlayListItem toPlay = new PlayListItem(item.Title, url); + playlist.Add(toPlay); + playlistPlayer.CurrentPlaylistType = type; + playlistPlayer.Play(0); + } + } + } +} Added: trunk/plugins/NRK Browser/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/NRK Browser/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/NRK Browser/Properties/AssemblyInfo.cs 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NRK Browser")] +[assembly: AssemblyDescription("Plugin for Media Portal")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NRK Browser")] +[assembly: AssemblyCopyright("Copyright © Terje Wiesener <wie...@sa...> 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7c80e1cd-6294-451f-88f1-1622403db953")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] Added: trunk/plugins/NRK Browser/SettingsForm.Designer.cs =================================================================== --- trunk/plugins/NRK Browser/SettingsForm.Designer.cs (rev 0) +++ trunk/plugins/NRK Browser/SettingsForm.Designer.cs 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,152 @@ +namespace NrkBrowser +{ + partial class SettingsForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.saveButton = new System.Windows.Forms.Button(); + this.speedLabel = new System.Windows.Forms.Label(); + this.speedUpDown = new System.Windows.Forms.NumericUpDown(); + this.unitLabel = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.osdPlayerCheckbox = new System.Windows.Forms.CheckBox(); + this.osdLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.speedUpDown)).BeginInit(); + this.SuspendLayout(); + // + // saveButton + // + this.saveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.saveButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.saveButton.Location = new System.Drawing.Point(201, 95); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(75, 23); + this.saveButton.TabIndex = 0; + this.saveButton.Text = "Save"; + this.saveButton.UseVisualStyleBackColor = true; + // + // speedLabel + // + this.speedLabel.AutoSize = true; + this.speedLabel.Location = new System.Drawing.Point(12, 14); + this.speedLabel.Name = "speedLabel"; + this.speedLabel.Size = new System.Drawing.Size(122, 17); + this.speedLabel.TabIndex = 1; + this.speedLabel.Text = "Connection speed"; + // + // speedUpDown + // + this.speedUpDown.Location = new System.Drawing.Point(157, 12); + this.speedUpDown.Maximum = new decimal(new int[] { + 16384, + 0, + 0, + 0}); + this.speedUpDown.Minimum = new decimal(new int[] { + 300, + 0, + 0, + 0}); + this.speedUpDown.Name = "speedUpDown"; + this.speedUpDown.Size = new System.Drawing.Size(72, 22); + this.speedUpDown.TabIndex = 2; + this.speedUpDown.Value = new decimal(new int[] { + 2048, + 0, + 0, + 0}); + // + // unitLabel + // + this.unitLabel.AutoSize = true; + this.unitLabel.Location = new System.Drawing.Point(235, 17); + this.unitLabel.Name = "unitLabel"; + this.unitLabel.Size = new System.Drawing.Size(34, 17); + this.unitLabel.TabIndex = 3; + this.unitLabel.Text = "kb/s"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(120, 95); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 4; + this.cancelButton.Text = "Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + // + // osdPlayerCheckbox + // + this.osdPlayerCheckbox.AutoSize = true; + this.osdPlayerCheckbox.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.osdPlayerCheckbox.Location = new System.Drawing.Point(156, 43); + this.osdPlayerCheckbox.Name = "osdPlayerCheckbox"; + this.osdPlayerCheckbox.Size = new System.Drawing.Size(18, 17); + this.osdPlayerCheckbox.TabIndex = 5; + this.osdPlayerCheckbox.UseVisualStyleBackColor = true; + // + // osdLabel + // + this.osdLabel.AutoSize = true; + this.osdLabel.Location = new System.Drawing.Point(12, 43); + this.osdLabel.Name = "osdLabel"; + this.osdLabel.Size = new System.Drawing.Size(138, 17); + this.osdLabel.TabIndex = 6; + this.osdLabel.Text = "Use player with OSD"; + // + // SettingsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(290, 130); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.osdPlayerCheckbox); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.speedLabel); + this.Controls.Add(this.osdLabel); + this.Controls.Add(this.unitLabel); + this.Controls.Add(this.speedUpDown); + this.Name = "SettingsForm"; + this.Text = "NrkBrowser settings"; + ((System.ComponentModel.ISupportInitialize)(this.speedUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.Label speedLabel; + private System.Windows.Forms.Label unitLabel; + public System.Windows.Forms.NumericUpDown speedUpDown; + private System.Windows.Forms.Button cancelButton; + public System.Windows.Forms.CheckBox osdPlayerCheckbox; + private System.Windows.Forms.Label osdLabel; + } +} \ No newline at end of file Added: trunk/plugins/NRK Browser/SettingsForm.cs =================================================================== --- trunk/plugins/NRK Browser/SettingsForm.cs (rev 0) +++ trunk/plugins/NRK Browser/SettingsForm.cs 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace NrkBrowser +{ + public partial class SettingsForm : Form + { + public SettingsForm() + { + InitializeComponent(); + } + } +} Added: trunk/plugins/NRK Browser/SettingsForm.resx =================================================================== --- trunk/plugins/NRK Browser/SettingsForm.resx (rev 0) +++ trunk/plugins/NRK Browser/SettingsForm.resx 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,120 @@ +<?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> +</root> \ No newline at end of file Added: trunk/plugins/NRK Browser/readme.txt =================================================================== --- trunk/plugins/NRK Browser/readme.txt (rev 0) +++ trunk/plugins/NRK Browser/readme.txt 2008-03-25 21:21:38 UTC (rev 1526) @@ -0,0 +1,21 @@ +To install the plugin, copy the contents of the INSTALL folder to your +Media Portal installation path (usually something like +C:\Program Files\Team Media Portal\Media Portal). + +If you are using a custom skin, you probably need to copy the skin file, +NrkBrowser.xml, to the folder containing your skin as well. + +If you experience any problems, please contact me and I will look into it +when I have time. + +Best regards, +Terje Wiesener <wie...@sa...> + +Changelog: + +Version 1.0.1.0 +- Fixed naming of skin folders +- Added configuration for connection speed + +Version 1.0.0.1 +- First release \ 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: <fif...@us...> - 2008-03-29 02:19:21
|
Revision: 1550 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1550&view=rev Author: fiftychickens Date: 2008-03-28 19:19:17 -0700 (Fri, 28 Mar 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Blackchicken.jpg trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Project6.ico Removed Paths: ------------- trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Black-chicken-by-Mark[2].jpg trunk/plugins/XBMCServer/ Deleted: trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Black-chicken-by-Mark[2].jpg =================================================================== (Binary files differ) Added: trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Blackchicken.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Blackchicken.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Project6.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/OzTiVoGrabber/OzTiVoGrabber/Resources/Project6.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-30 12:31:51
|
Revision: 1566 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1566&view=rev Author: and-81 Date: 2008-03-30 05:31:45 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.nsi.old trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/AppData/Remote Presets/Abstract Remote Model.xml trunk/plugins/IR Server Suite/setup.nsi trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MappedEvent.cs Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -20,8 +20,8 @@ public class KeyboardInput : PluginBase, IRemoteReceiver { - #region Debug -#if DEBUG + // #define TEST_APPLICATION in the project properties when creating the console test app ... +#if TEST_APPLICATION static void Remote(string deviceName, string code) { @@ -31,19 +31,33 @@ [STAThread] static void Main() { - KeyboardInput c = new KeyboardInput(); - c.RemoteCallback += new RemoteHandler(Remote); + KeyboardInput c; - c.Start(); + try + { + c = new KeyboardInput(); - Application.Run(); + c.RemoteCallback += new RemoteHandler(Remote); - c.Stop(); - c = null; + c.Start(); + + Application.Run(); + + c.Stop(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + finally + { + c = null; + } + + Console.ReadKey(); } #endif - #endregion Debug #region Interop Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -17,6 +17,46 @@ public class TechnotrendReceiver : PluginBase, IRemoteReceiver { + // #define TEST_APPLICATION in the project properties when creating the console test app ... +#if TEST_APPLICATION + + static void Remote(string deviceName, string code) + { + Console.WriteLine("Remote: {0}", code); + } + + [STAThread] + static void Main() + { + TechnotrendReceiver c; + + try + { + c = new TechnotrendReceiver(); + + c.RemoteCallback += new RemoteHandler(Remote); + + c.Start(); + + System.Windows.Forms.Application.Run(); + + c.Stop(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + finally + { + c = null; + } + + Console.ReadKey(); + } + +#endif + + #region Enumerations /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj 2008-03-30 12:31:45 UTC (rev 1566) @@ -62,6 +62,7 @@ <ItemGroup> <Reference Include="System" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -64,7 +64,6 @@ const int DeviceBufferSize = 7; const string DevicePathVidPid = "vid_045e&pid_0284"; - // const string DevicePathVidPid = "vid_1130&pid_cc00"; Asus DH Remote #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Suite.nsi.old =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.nsi.old 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/IR Server Suite.nsi.old 2008-03-30 12:31:45 UTC (rev 1566) @@ -427,6 +427,7 @@ File "IR Server Plugins\Serial IR Blaster\bin\${BuildType}\Serial IR Blaster.*" ;File "IR Server Plugins\Speech Receiver\bin\${BuildType}\Speech Receiver.*" File "IR Server Plugins\Technotrend Receiver\bin\${BuildType}\Technotrend Receiver.*" + File "IR Server Plugins\Technotrend Receiver\bin\${BuildType}\ttBdaDrvApi_Dll.dll" ;File "IR Server Plugins\Tira Transceiver\bin\${BuildType}\Tira Transceiver.*" File "IR Server Plugins\USB-UIRT Transceiver\bin\${BuildType}\USB-UIRT Transceiver.*" File "IR Server Plugins\Wii Remote Receiver\bin\${BuildType}\Wii Remote Receiver.*" Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/AppData/Remote Presets/Abstract Remote Model.xml =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/AppData/Remote Presets/Abstract Remote Model.xml 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/AppData/Remote Presets/Abstract Remote Model.xml 2008-03-30 12:31:45 UTC (rev 1566) @@ -44,7 +44,7 @@ <code value="Left" /> </button> <button name="Ok"> - <code value="Ok" /> + <code value="OK" /> </button> <button name="Right"> <code value="Right" /> Modified: trunk/plugins/IR Server Suite/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup.nsi 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/IR Server Suite/setup.nsi 2008-03-30 12:31:45 UTC (rev 1566) @@ -401,6 +401,7 @@ File "IR Server Plugins\Serial IR Blaster\bin\${BuildType}\Serial IR Blaster.*" ;File "IR Server Plugins\Speech Receiver\bin\${BuildType}\Speech Receiver.*" File "IR Server Plugins\Technotrend Receiver\bin\${BuildType}\Technotrend Receiver.*" + File "IR Server Plugins\Technotrend Receiver\bin\${BuildType}\ttBdaDrvApi_Dll.dll" ;File "IR Server Plugins\Tira Transceiver\bin\${BuildType}\Tira Transceiver.*" File "IR Server Plugins\USB-UIRT Transceiver\bin\${BuildType}\USB-UIRT Transceiver.*" File "IR Server Plugins\Wii Remote Receiver\bin\${BuildType}\Wii Remote Receiver.*" Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -646,10 +646,10 @@ MCEReplacement.EventMapperEnabled = checkBoxEventMapper.Checked; MCEReplacement.MouseModeEnabled = checkBoxMouseMode.Checked; - MCEReplacement.MouseModeButton = (RemoteButton)Enum.Parse(typeof(RemoteButton), (string)comboBoxMouseModeButton.SelectedItem); + MCEReplacement.MouseModeButton = (RemoteButton)Enum.Parse(typeof(RemoteButton), (string)comboBoxMouseModeButton.SelectedItem, true); MCEReplacement.MouseModeStep = Decimal.ToInt32(numericUpDownMouseStep.Value); - MCEReplacement.MultiMappingButton = (RemoteButton)Enum.Parse(typeof(RemoteButton), (string)comboBoxMultiButton.SelectedItem); + MCEReplacement.MultiMappingButton = (RemoteButton)Enum.Parse(typeof(RemoteButton), (string)comboBoxMultiButton.SelectedItem, true); SaveMultiMappings(); Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -1272,7 +1272,7 @@ codeValue = -1; remoteMap[i++] = codeValue; - remoteMap[i++] = (int)Enum.Parse(typeof(RemoteButton), name); + remoteMap[i++] = (int)Enum.Parse(typeof(RemoteButton), name, true); } } } Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2008-03-30 12:31:45 UTC (rev 1566) @@ -137,7 +137,6 @@ <Private>False</Private> </Reference> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.ServiceProcess" /> <Reference Include="System.Windows.Forms" /> Modified: trunk/plugins/MCEReplacement/MappedEvent.cs =================================================================== --- trunk/plugins/MCEReplacement/MappedEvent.cs 2008-03-30 11:51:14 UTC (rev 1565) +++ trunk/plugins/MCEReplacement/MappedEvent.cs 2008-03-30 12:31:45 UTC (rev 1566) @@ -288,7 +288,7 @@ if (String.IsNullOrEmpty(commandString)) return null; - string[] eventStringElements = eventString.Split(new char[] { ',', '=' }, StringSplitOptions.None); + string[] eventStringElements = eventString.Split(',', '='); if (eventStringElements.Length == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-30 14:50:16
|
Revision: 1567 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1567&view=rev Author: and-81 Date: 2008-03-30 07:50:10 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html Added Paths: ----------- trunk/plugins/TelnetInterface/ trunk/plugins/TelnetInterface/Properties/ trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs trunk/plugins/TelnetInterface/TelnetInterface.cs trunk/plugins/TelnetInterface/TelnetInterface.csproj Property Changed: ---------------- trunk/plugins/XBMCServer/ Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-30 12:31:45 UTC (rev 1566) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-30 14:50:10 UTC (rev 1567) @@ -63,6 +63,8 @@ <LI>Input Service Configuration: Added Start and Stop buttons to the toolbar.</LI> <LI>Girder Plugin: Fixed a few bugs.</LI> <LI>Installer: More installer improvements thanks to Chef_Koch.</LI> +<LI>Installer: Added a required file for Technotrend remote.</LI> +<LI>Abstract Remote Model: Corrected a bug in the Abstract Remote Map for MP Control Plugin.</LI> </UL></P> <BR> Property changes on: trunk/plugins/TelnetInterface ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs 2008-03-30 14:50:10 UTC (rev 1567) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MediaPortal Telnet Interface")] +[assembly: AssemblyDescription("Provides a telnet interface to interact with MediaPortal")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TelnetInterface")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("189fd744-e73f-4515-b593-e2484f9a9ef0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] Added: trunk/plugins/TelnetInterface/TelnetInterface.cs =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.cs (rev 0) +++ trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-03-30 14:50:10 UTC (rev 1567) @@ -0,0 +1,369 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +//using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Util; + + +namespace MediaPortal.Plugins +{ + + public class TelnetInterface : IPlugin, ISetupForm + { + + #region Constant + + const int SocketBacklog = 10; + + #endregion Constant + + #region Variables + + int _serverPort; + Socket _serverSocket; + + IPEndPoint _localEndPoint; + + Thread _connectionThread; + + bool _processConnectionThread; + + #endregion Variables + + #region IPlugin Members + + /// <summary> + /// Starts this instance. + /// </summary> + public void Start() + { + _serverPort = 23; + _processConnectionThread = true; + + try + { + _localEndPoint = new IPEndPoint(IPAddress.Any, _serverPort); + + _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + _serverSocket.Bind(_localEndPoint); + _serverSocket.Listen(SocketBacklog); + + _connectionThread = new Thread(new ThreadStart(ConnectionThread)); + _connectionThread.Name = "TelnetInterface.ConnectionThread"; + _connectionThread.IsBackground = true; + _connectionThread.Start(); + } + catch (Exception ex) + { + Log.Error(ex); + + _processConnectionThread = false; + _serverSocket = null; + _localEndPoint = null; + _connectionThread = null; + } + } + + /// <summary> + /// Stops this instance. + /// </summary> + public void Stop() + { + _processConnectionThread = false; + + if (_serverSocket != null) + _serverSocket.Close(); + + _serverSocket = null; + _localEndPoint = null; + _connectionThread = null; + } + + #endregion IPlugin Members + + #region ISetupForm Members + + public string Author() { return "and-81"; } + public bool CanEnable() { return true; } + public bool DefaultEnabled() { return true; } + public string Description() { return "Provides a telnet interface to control and interact with MediaPortal"; } + + /// <summary> + /// Gets the home screen details for the plugin. + /// </summary> + /// <param name="strButtonText">The button text.</param> + /// <param name="strButtonImage">The button image.</param> + /// <param name="strButtonImageFocus">The button image focus.</param> + /// <param name="strPictureImage">The picture image.</param> + /// <returns>true if the plugin can be seen, otherwise false.</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; + return false; + } + + public int GetWindowId() { return 0; } + + public bool HasSetup() { return false; } + + public string PluginName() { return "Telnet Interface"; } + + public void ShowPlugin() + { + + } + + #endregion ISetupForm Members + + + void SocketSend(Socket socket, string text) + { + byte[] textBytes = Encoding.ASCII.GetBytes(text + "\n\r"); + socket.Send(textBytes); + } + + void ConnectionThread() + { + try + { + while (_processConnectionThread) + { + Socket socket = _serverSocket.Accept(); + socket.Blocking = true; + + SocketSend(socket, "MediaPortal Telnet Interface"); + + Thread communicationThread = new Thread(new ParameterizedThreadStart(CommunicationThread)); + communicationThread.Name = "TelnetInterface.CommunicationThread"; + communicationThread.IsBackground = true; + communicationThread.Start(socket); + } + } + catch (SocketException ex) + { + Log.Warn(ex.ToString()); + } + catch (Exception ex) + { + Log.Error(ex); + } + } + + + void CommunicationThread(object socketObj) + { + Socket socket = socketObj as Socket; + if (socket == null) + { + Log.Error("TelnetInterface: CommunicationThread received invalid Socket Object"); + return; + } + + try + { + byte[] buffer = new byte[4096]; + + while (socket.Connected) + { + StringBuilder command = new StringBuilder(); + + while (true) + { + int readBytes = socket.Receive(buffer); + string input = Encoding.ASCII.GetString(buffer, 0, readBytes); + + command.Append(input); + + Log.Debug(BitConverter.ToString(buffer, 0, readBytes)); + + if (command[command.Length - 1] == '\r') + { + command.Remove(command.Length - 1, 1); + break; + } + } + + ProcessCommand(socket, command.ToString()); + } + } + catch (SocketException ex) + { + Log.Warn(ex.ToString()); + } + catch (Exception ex) + { + Log.Error(ex); + } + } + + + + void ProcessCommand(Socket socket, string text) + { + string[] words = text.Split(' '); + string keyWord = words[0].ToUpperInvariant(); + + string log = String.Format("Incoming Command: {0}", text); + Log.Debug("TelnetInterface: " + log); + SocketSend(socket, log); + + switch (keyWord) + { + case "GET": CommandGet(socket, words); break; + case "SET": CommandSet(socket, words); break; + + case "GOTO": CommandGoto(socket, words); break; + + case "PLAY": CommandPlay(socket, words); break; + + case "ACTION": CommandAction(socket, words); break; + + case "EXIT": CommandExitMP(socket); break; + + case "HELP": CommandHelp(socket); break; + + case "BYE": CommandClose(socket); break; + + + default: + string message = String.Format("Unknown Command Type: {0}", keyWord); + + Log.Warn("TelnetInterface: " + message); + + SocketSend(socket, message); + break; + } + } + + void CommandHelp(Socket socket) + { + SocketSend(socket, "Available commands:"); + SocketSend(socket, ""); + SocketSend(socket, "GET ACTIONS, GET SCREENS, GOTO <Screen>, PLAY <File>, ACTION <Action>, EXIT, BYE"); + SocketSend(socket, ""); + SocketSend(socket, "GET ACTIONS - Returns a list of MediaPortal actions the ACTION command can trigger"); + SocketSend(socket, "GET SCREENS - Returns a list of MediaPortal screens the GOTO command can use"); + SocketSend(socket, "GOTO <Screen> - Make MediaPortal move to another screen, can be the screen name from the GET SCREENS command, or the screen ID from it's XML file"); + SocketSend(socket, "PLAY <File> - Play the music/video file specified"); + SocketSend(socket, "ACTION <Action> - Trigger a MediaPortal action, this must be one of the actions from the GET ACTIONS command"); + SocketSend(socket, "EXIT - Quit MediaPortal"); + SocketSend(socket, "BYE - Close the Telnet session"); + } + + void CommandGet(Socket socket, string[] words) + { + string value = words[1].ToUpperInvariant(); + + switch (value) + { + case "ACTIONS": + foreach (string type in Enum.GetNames(typeof(Action.ActionType))) + SocketSend(socket, type); + break; + + case "SCREENS": + foreach (string type in Enum.GetNames(typeof(GUIWindow.Window))) + SocketSend(socket, type); + break; + } + + } + + void CommandSet(Socket socket, string[] words) + { + string value = words[1].ToUpperInvariant(); + + } + + void CommandGoto(Socket socket, string[] words) + { + string value = words[1].ToUpperInvariant(); + + int window = (int)GUIWindow.Window.WINDOW_INVALID; + + try + { + window = (int)Enum.Parse(typeof(GUIWindow.Window), value, true); + } + catch (ArgumentException) + { + // Parsing the window id as a GUIWindow.Window failed, so parse it as an int + } + + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + int.TryParse(value, out window); + + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + { + string message = String.Format("Cannot goto screen \"{0}\", not a valid screen name or number", value); + + Log.Warn(message); + SocketSend(socket, message); + } + + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, window, 0, null)); + } + + void CommandPlay(Socket socket, string[] words) + { + GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAY_FILE, 0, 0, 0, 0, 0, null); + message.Label = words[1]; + + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(message); + } + + void CommandAction(Socket socket, string[] words) + { + Action.ActionType type; + + try + { + type = (Action.ActionType)Enum.Parse(typeof(Action.ActionType), words[1], true); + } + catch (Exception ex) + { + Log.Error(ex); + + SocketSend(socket, String.Format("Could not convert \"{0}\" to a valid Action", words[1])); + return; + } + + SocketSend(socket, String.Format("Sending MediaPortal Action: {0}", Enum.GetName(typeof(Action.ActionType), type))); + + Action action = new Action(type, 0, 0); + GUIGraphicsContext.OnAction(action); + } + + + + void CommandExitMP(Socket socket) + { + Log.Info("TelnetInterface: Request to close MediaPortal received"); + + SocketSend(socket, "Closing MediaPortal (closing telnet connection)"); + + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_EXIT, 0, 0)); + + socket.Close(); + } + + + + void CommandClose(Socket socket) + { + SocketSend(socket, "Closing telnet connection"); + socket.Close(); + } + + } + +} Added: trunk/plugins/TelnetInterface/TelnetInterface.csproj =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.csproj (rev 0) +++ trunk/plugins/TelnetInterface/TelnetInterface.csproj 2008-03-30 14:50:10 UTC (rev 1567) @@ -0,0 +1,58 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{E8DE467F-0BD7-49CE-A5AC-4F1482EF04B6}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>TelnetInterface</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="TelnetInterface.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: trunk/plugins/XBMCServer ___________________________________________________________________ Name: svn:ignore + obj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-03-30 18:00:28
|
Revision: 1568 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1568&view=rev Author: chef_koch Date: 2008-03-30 11:00:16 -0700 (Sun, 30 Mar 2008) Log Message: ----------- renamed myprograms directory Added Paths: ----------- trunk/plugins/MyProgramsAlt/ Removed Paths: ------------- trunk/plugins/myGUIProgramsAlt/ Copied: trunk/plugins/MyProgramsAlt (from rev 1567, trunk/plugins/myGUIProgramsAlt) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-03-30 22:39:02
|
Revision: 1569 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1569&view=rev Author: chef_koch Date: 2008-03-30 15:39:00 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyPrograms/ trunk/plugins/MyPrograms/ApplicationItems/ trunk/plugins/MyPrograms/ApplicationItems/AppItem.cs trunk/plugins/MyPrograms/ApplicationItems/AppItemGamebase.cs trunk/plugins/MyPrograms/ApplicationItems/AppList.cs trunk/plugins/MyPrograms/ApplicationItems/ApplicationFactory.cs trunk/plugins/MyPrograms/ApplicationItems/MyFileIniImporter.cs trunk/plugins/MyPrograms/ApplicationItems/MyFileIniReader.cs trunk/plugins/MyPrograms/ApplicationItems/MyFileMeedioImporter.cs trunk/plugins/MyPrograms/ApplicationItems/MyGamebaseImporter.cs trunk/plugins/MyPrograms/ApplicationItems/MyMameImporter.cs trunk/plugins/MyPrograms/ApplicationItems/appDirBrowse.cs trunk/plugins/MyPrograms/ApplicationItems/appDirCache.cs trunk/plugins/MyPrograms/ApplicationItems/appFilesEdit.cs trunk/plugins/MyPrograms/ApplicationItems/appGrouper.cs trunk/plugins/MyPrograms/ApplicationItems/appItemAppExec.cs trunk/plugins/MyPrograms/ApplicationItems/appItemMameDirect.cs trunk/plugins/MyPrograms/ApplicationItems/appMyFileIni.cs trunk/plugins/MyPrograms/ApplicationItems/appMyFileMeedio.cs trunk/plugins/MyPrograms/Configuration/ trunk/plugins/MyPrograms/Configuration/AppFilesImportProgress.cs trunk/plugins/MyPrograms/Configuration/AppFilesImportProgress.resx trunk/plugins/MyPrograms/Configuration/AppFilesView.cs trunk/plugins/MyPrograms/Configuration/AppFilesView.resx trunk/plugins/MyPrograms/Configuration/AppSettings.cs trunk/plugins/MyPrograms/Configuration/AppSettings.resx trunk/plugins/MyPrograms/Configuration/AppSettingsAppExec.cs trunk/plugins/MyPrograms/Configuration/AppSettingsAppExec.resx trunk/plugins/MyPrograms/Configuration/AppSettingsDirBrowse.cs trunk/plugins/MyPrograms/Configuration/AppSettingsDirBrowse.resx trunk/plugins/MyPrograms/Configuration/AppSettingsDirCache.cs trunk/plugins/MyPrograms/Configuration/AppSettingsDirCache.resx trunk/plugins/MyPrograms/Configuration/AppSettingsFilelauncher.cs trunk/plugins/MyPrograms/Configuration/AppSettingsFilelauncher.resx trunk/plugins/MyPrograms/Configuration/AppSettingsGamebase.cs trunk/plugins/MyPrograms/Configuration/AppSettingsGamebase.resx trunk/plugins/MyPrograms/Configuration/AppSettingsGrouper.cs trunk/plugins/MyPrograms/Configuration/AppSettingsGrouper.resx trunk/plugins/MyPrograms/Configuration/AppSettingsMameDirect.cs trunk/plugins/MyPrograms/Configuration/AppSettingsMameDirect.resx trunk/plugins/MyPrograms/Configuration/AppSettingsMyFileIni.cs trunk/plugins/MyPrograms/Configuration/AppSettingsMyFileIni.resx trunk/plugins/MyPrograms/Configuration/AppSettingsMyFileMeedio.cs trunk/plugins/MyPrograms/Configuration/AppSettingsMyFileMeedio.resx trunk/plugins/MyPrograms/Configuration/AppSettingsPrePost.cs trunk/plugins/MyPrograms/Configuration/AppSettingsPrePost.resx trunk/plugins/MyPrograms/Configuration/AppSettingsRoot.cs trunk/plugins/MyPrograms/Configuration/AppSettingsRoot.resx trunk/plugins/MyPrograms/Configuration/FileDetailsForm.cs trunk/plugins/MyPrograms/Configuration/FileDetailsForm.resx trunk/plugins/MyPrograms/Configuration/FileInfoScraperForm.cs trunk/plugins/MyPrograms/Configuration/FileInfoScraperForm.resx trunk/plugins/MyPrograms/Configuration/ProgramViews.cs trunk/plugins/MyPrograms/Configuration/ProgramViews.resx trunk/plugins/MyPrograms/Configuration/SetupForm.cs trunk/plugins/MyPrograms/Configuration/SetupForm.resx trunk/plugins/MyPrograms/Configuration/taggedMenuItem.cs trunk/plugins/MyPrograms/Configuration/taggedMenuItem.resx trunk/plugins/MyPrograms/FileItems/ trunk/plugins/MyPrograms/FileItems/FileInfo.cs trunk/plugins/MyPrograms/FileItems/FileItem.cs trunk/plugins/MyPrograms/FileItems/FileList.cs trunk/plugins/MyPrograms/FileItems/FilelinkItem.cs trunk/plugins/MyPrograms/FileItems/FilelinkList.cs trunk/plugins/MyPrograms/GUIPrograms/ trunk/plugins/MyPrograms/GUIPrograms/AllGameInfoScraper.cs trunk/plugins/MyPrograms/GUIPrograms/GUIProgramInfo.cs trunk/plugins/MyPrograms/GUIPrograms/GUIPrograms.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramComparer.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramContentManager.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramDBComparer.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramDatabase.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramFilterItem.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramSettings.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramSort.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramState.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramUtils.cs trunk/plugins/MyPrograms/GUIPrograms/ProgramViewHandler.cs trunk/plugins/MyPrograms/GUIPrograms.Base/ trunk/plugins/MyPrograms/GUIPrograms.Base/FileDetailContents.xml trunk/plugins/MyPrograms/GUIPrograms.Base/ProgramSettingProfiles.xml trunk/plugins/MyPrograms/GUIPrograms.Base/defaultProgramViews.xml trunk/plugins/MyPrograms/GUIPrograms.Base/grabber_AllGame_com.xml trunk/plugins/MyPrograms/GUIPrograms.Base/skin/ trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo/ trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo/DialogFileInfo.xml trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo/myprograms.xml trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo wide/ trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo wide/DialogFileInfo.xml trunk/plugins/MyPrograms/GUIPrograms.Base/skin/BlueTwo wide/myprograms.xml trunk/plugins/MyPrograms/GUIPrograms.csproj trunk/plugins/MyPrograms/GUIPrograms.xmp trunk/plugins/MyPrograms/Properties/ trunk/plugins/MyPrograms/Properties/AssemblyInfo.cs Added: trunk/plugins/MyPrograms/ApplicationItems/AppItem.cs =================================================================== --- trunk/plugins/MyPrograms/ApplicationItems/AppItem.cs (rev 0) +++ trunk/plugins/MyPrograms/ApplicationItems/AppItem.cs 2008-03-30 22:39:00 UTC (rev 1569) @@ -0,0 +1,1301 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Collections; +using System.Diagnostics; +using System.Xml; + +using SQLite.NET; + +using MediaPortal.Ripper; +using MediaPortal.Player; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.GUIPrograms +{ + /// <summary> + /// Summary description for AppItem. + /// </summary> + public class AppItem + { + protected static SQLiteClient sqlDB = null; + private ProgramDBComparer dbPc = new ProgramDBComparer(); + + public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); + + public event FilelinkLaunchEventHandler OnLaunchFilelink = null; + + int appID; + int fatherID; + string title; + string shortTitle; + string filename; + string arguments; + ProcessWindowStyle windowStyle; + string startupDir; + bool useShellExecute; + bool useQuotes; + myProgSourceType sourceType; + string sourceFile; + string imageFile; + string imageDirectories; // in one string for sqlite db field + public string[] imageDirs; // imageDirectories splitted + string fileDirectory; + string validExtensions; + bool importValidImagesOnly; + int appPosition; + bool enabled; + bool enableGUIRefresh; + int pincode; + int contentID; + string systemDefault; + bool waitForExit; + string preLaunch; + string postLaunch; + + + string launchErrorMsg; + + + // two magic image-slideshow counters + int thumbIndex = 0; + int thumbFolderIndex = -1; + + string lastFilepath = ""; // cached path + + public bool filesAreLoaded = false; // load on demand.... + protected Filelist fileList = null; + + public bool linksAreLoaded = false; + protected FilelinkList fileLinks = null; + + string _currentView = ""; + + // event: read new file + public delegate void RefreshInfoEventHandler(string curLine); + + public event RefreshInfoEventHandler OnRefreshInfo = null; + + protected void SendRefreshInfo(string Message) + { + if (OnRefreshInfo != null) + { + OnRefreshInfo(Message); + } + } + + protected int GetID = ProgramUtils.GetID; + + public AppItem(SQLiteClient initSqlDB) + { + + // constructor: save SQLiteDB object + sqlDB = initSqlDB; + // .. init member variables ... + appID = -1; + fatherID = -1; + title = ""; + shortTitle = ""; + filename = ""; + arguments = ""; + windowStyle = ProcessWindowStyle.Normal; + startupDir = ""; + useShellExecute = false; + useQuotes = true; + enabled = true; + sourceType = myProgSourceType.UNKNOWN; + sourceFile = ""; + imageFile = ""; + fileDirectory = ""; + imageDirectories = ""; + validExtensions = ""; + appPosition = 0; + importValidImagesOnly = false; + enableGUIRefresh = false; + pincode = -1; + contentID = 100; + systemDefault = ""; + waitForExit = true; + filesAreLoaded = false; + preLaunch = ""; + postLaunch = ""; + } + + public SQLiteClient db + { + get { return sqlDB; } + } + + public int CurrentSortIndex + { + get { return GetCurrentSortIndex(); } + set { SetCurrentSortIndex(value); } + } + + public bool CurrentSortIsAscending + { + get { return GetCurrentSortIsAscending(); } + set { SetCurrentSortIsAscending(value); } + } + + public FileItem PrevFile(FileItem curFile) + { + if (Files == null) + { + return null; + } + if (Files.Count == 0) + { + return null; + } + int index = this.Files.IndexOf(curFile); + index = index - 1; + if (index < 0) + index = Files.Count - 1; + return (FileItem)Files[index]; + } + + public FileItem NextFile(FileItem curFile) + { + if (Files == null) + { + return null; + } + if (Files.Count == 0) + { + return null; + } + int index = this.Files.IndexOf(curFile); + index = index + 1; + if (index > Files.Count - 1) + index = 0; + return (FileItem)Files[index]; + } + + protected void LaunchGenericPlayer(string command, string filename) + { + // quick&dirty: remove placeholder out of the filename + filename = filename.Replace("%PLAY%", ""); + filename = filename.Replace("%PLAYAUDIOSTREAM%", ""); + filename = filename.Replace("%PLAYVIDEOSTREAM%", ""); + // don't use quotes! + filename = filename.Trim(); + filename = filename.TrimStart('\"'); + filename = filename.TrimEnd('\"'); + if (command == "%PLAY%") + { + g_Player.Play(filename); + } + else if (command == "%PLAYAUDIOSTREAM%") + { + g_Player.PlayAudioStream(filename); + } + else if (command == "%PLAYVIDEOSTREAM%") + { + g_Player.PlayVideoStream(filename); + } + else + { + Log.Info("error in myPrograms: AppItem.LaunchGenericPlayer: unknown command: {0}", command); + return; + } + if (MediaPortal.Util.Utils.IsVideo(filename)) + { + g_Player.ShowFullScreenWindow(); + } + return; + } + + public virtual void LaunchFile(FileItem curFile, bool mpGuiMode) + { + string curFilename = curFile.Filename; + if (curFilename == "") + return; + + // Launch File by item + if (mpGuiMode) + { + curFile.UpdateLaunchInfo(); + } + + ProcessStartInfo procStart = new ProcessStartInfo(); + if (this.Filename != "") + { + // use the APPLICATION launcher and add current file information + procStart.FileName = Filename; // filename of the application + // set the arguments: one of the arguments is the fileitem-filename + procStart.Arguments = " " + this.Arguments + " "; + if (UseQuotes) + { + // avoid double quotes around the filename-argument..... + curFilename = "\"" + curFile.Filename.Trim('\"') + "\""; + } + + if (procStart.Arguments.IndexOf("%FILEnoPATHnoEXT%") >= 0) + { + // ex. kawaks: + // winkawaks.exe alpham2 + // => filename without path and extension is necessary! + string filenameNoPathNoExt = curFile.ExtractFileName(); + filenameNoPathNoExt = filenameNoPathNoExt.Trim('\"'); + filenameNoPathNoExt = Path.GetFileNameWithoutExtension(filenameNoPathNoExt); + procStart.Arguments = procStart.Arguments.Replace("%FILEnoPATHnoEXT%", filenameNoPathNoExt); + } + else + { + // the fileitem-argument can be positioned anywhere in the argument string... + if (procStart.Arguments.IndexOf("%FILE%") == -1) + { + // no placeholder found => default handling: add the fileitem as the last argument + procStart.Arguments = procStart.Arguments + curFilename; + } + else + { + // placeholder found => replace the placeholder by the correct filename + procStart.Arguments = procStart.Arguments.Replace("%FILE%", curFilename); + } + } + procStart.WorkingDirectory = Startupdir; + if (procStart.WorkingDirectory.IndexOf("%FILEDIR%") != -1) + { + procStart.WorkingDirectory = procStart.WorkingDirectory.Replace("%FILEDIR%", Path.GetDirectoryName(curFile.Filename)); + } + } + else + { + // application has no launch-file + // => try to make a correct launch using the current FILE object + string guessedFilename = curFile.ExtractFileName(); + procStart.FileName = guessedFilename; + procStart.Arguments = curFile.ExtractArguments(); + if (procStart.Arguments != "") + { + guessedFilename = procStart.Arguments; + } + procStart.WorkingDirectory = curFile.ExtractDirectory(guessedFilename); + } + procStart.UseShellExecute = this.UseShellExecute; + procStart.WindowStyle = this.WindowStyle; + + bool useGenericPlayer = (procStart.FileName.ToUpper() == "%PLAY%") || + (procStart.FileName.ToUpper() == "%PLAYAUDIOSTREAM%") || + (procStart.FileName.ToUpper() == "%PLAYVIDEOSTREAM%"); + + this.LaunchErrorMsg = ""; + try + { + DoPreLaunch(); + if (useGenericPlayer) + { + // use generic player + if (mpGuiMode) + { + LaunchGenericPlayer(procStart.FileName, curFilename); + return; + } + else + { + // generic player can only be used in MPGUI mode! + // => Apologize to the user :-) + string problemString = "Sorry! The internal generic players cannot be used in Configuration. \nTry it in the MediaPortal application!"; + this.LaunchErrorMsg = problemString; + } + } + else + { + if (mpGuiMode) + { + AutoPlay.StopListening(); + if (g_Player.Playing) + { + g_Player.Stop(); + } + } + MediaPortal.Util.Utils.StartProcess(procStart, WaitForExit); + if (mpGuiMode) + { + GUIGraphicsContext.DX9Device.Reset(GUIGraphicsContext.DX9Device.PresentationParameters); + AutoPlay.StartListening(); + } + } + } + catch (Exception ex) + { + string ErrorString = String.Format("myPrograms: error launching program\n filename: {0}\n arguments: {1}\n WorkingDirectory: {2}\n stack: {3} {4} {5}", + procStart.FileName, + procStart.Arguments, + procStart.WorkingDirectory, + ex.Message, + ex.Source, + ex.StackTrace); + Log.Info(ErrorString); + this.LaunchErrorMsg = ErrorString; + } + finally + { + DoPostLaunch(); + } + } + + protected void DoPreLaunch() + { + if (waitForExit && (preLaunch != "")) + { + LaunchCmd(preLaunch); + } + } + + protected void DoPostLaunch() + { + if (waitForExit && (preLaunch != "")) + { + LaunchCmd(postLaunch); + } + } + + protected void LaunchCmd(string commands) + { + string results = ""; + string errors = ""; + string[] script; + string curLine; + Process p = new Process(); + StreamWriter sw; + StreamReader sr; + StreamReader err; + + script = commands.Split('\r'); + if (script.Length > 0) + { + ProcessStartInfo psI = new ProcessStartInfo("cmd"); + psI.UseShellExecute = false; + psI.RedirectStandardInput = true; + psI.RedirectStandardOutput = true; + psI.RedirectStandardError = true; + psI.CreateNoWindow = true; + p.StartInfo = psI; + + p.Start(); + sw = p.StandardInput; + sr = p.StandardOutput; + err = p.StandardError; + + sw.AutoFlush = true; + + for (int i = 0; i < script.Length; i++) + { + curLine = script[i].Trim(); + curLine = curLine.TrimStart('\n'); + if (curLine != "") + sw.WriteLine(curLine); + } + sw.Close(); + + results += sr.ReadToEnd(); + errors += err.ReadToEnd(); + + if (errors.Trim() != "") + { + Log.Info("AppItem PrePost errors: {0}", errors); + } + } + + } + + public virtual void LaunchFile(GUIListItem item) + { + // Launch File by GUILISTITEM + // => look for FileItem and launch it using the found object + if (item.MusicTag == null) + return; + FileItem curFile = item.MusicTag as FileItem; + if (curFile == null) + return; + this.LaunchFile(curFile, true); + } + + protected virtual void LaunchFilelink(FilelinkItem curLink, bool MPGUIMode) + { + this.OnLaunchFilelink(curLink, MPGUIMode); + } + + public virtual string DefaultFilepath() + { + return ""; // override this if the appitem can have subfolders + } + + public virtual int DisplayFiles(string filePath, GUIFacadeControl facadeView) + { + int totalItems = 0; + if (filePath != lastFilepath) + { + Files.Load(AppID, filePath); + Filelinks.Load(AppID, filePath); + } + totalItems = totalItems + DisplayArrayList(filePath, this.Files, facadeView); + totalItems = totalItems + DisplayArrayList(filePath, this.Filelinks, facadeView); + lastFilepath = filePath; + return totalItems; + } + + protected int DisplayArrayList(string filePath, ArrayList dbItems, GUIFacadeControl facadeView) + { + int totalItems = 0; + //foreach (FileItem curFile in dbItems) + foreach (object obj in dbItems) + { + totalItems = totalItems + 1; + if (obj is FileItem) + { + FileItem curFile = obj as FileItem; + GUIListItem item = new GUIListItem(curFile.Title); + item.Label2 = curFile.Title2; + item.MusicTag = curFile; + item.IsFolder = curFile.IsFolder; + item.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); + item.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnFileItemSelected); + facadeView.Add(item); + } + else if (obj is ProgramFilterItem) + { + ProgramFilterItem curFilter = obj as ProgramFilterItem; + GUIListItem item = new GUIListItem(curFilter.Title); + item.Label2 = curFilter.Title2; // some filters may have more than one text + item.MusicTag = curFilter; + item.IsFolder = true; + item.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnFileItemSelected); + facadeView.Add(item); + } + } + return totalItems; + } + + void OnRetrieveCoverArt(GUIListItem gli) + { + if ((gli.MusicTag != null) && (gli.MusicTag is FileItem)) + { + FileItem curFile = (FileItem)gli.MusicTag; + if (curFile.Imagefile != "") + { + gli.ThumbnailImage = curFile.Imagefile; + gli.IconImageBig = curFile.Imagefile; + gli.IconImage = curFile.Imagefile; + } + else + { + gli.ThumbnailImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; + gli.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; + gli.IconImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderNF.png"; + } + } + } + + private void OnFileItemSelected(GUIListItem item, GUIControl parent) + { + GUIPrograms.ThumbnailPath = ""; + if (item.ThumbnailImage != "" + && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" + && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" + ) + { + // only show big thumb if there is really one.... + GUIPrograms.ThumbnailPath = item.ThumbnailImage; + } + } + + public virtual void OnSort(GUIFacadeControl view, bool doSwitchState) + { + /* + * if (!filesAreLoaded) + { + LoadFiles(); + } + + if (doSwitchState) + { + dbPc.updateState(); + } + view.Sort(dbPc); + */ + } + + public virtual void OnSortToggle(GUIFacadeControl view) + { + dbPc.sortAscending = (!dbPc.sortAscending); + view.Sort(dbPc); + } + + public virtual int GetCurrentSortIndex() + { + return dbPc.currentSortMethodIndex; + } + + public virtual void SetCurrentSortIndex(int newValue) + { + dbPc.currentSortMethodIndex = newValue; + } + + public virtual string CurrentSortTitle() + { + return dbPc.currentSortMethodAsText; + } + + public virtual bool GetCurrentSortIsAscending() + { + return dbPc.sortAscending; + } + + public virtual void SetCurrentSortIsAscending(bool newValue) + { + dbPc.sortAscending = newValue; + } + + public virtual bool RefreshButtonVisible() + { + return false; // otherwise, override this in child class + } + + public virtual bool FileEditorAllowed() + { + return true; // otherwise, override this in child class + } + + public virtual bool FileAddAllowed() + { + return true; // otherwise, override this in child class + } + + public virtual bool FilesCanBeFavourites() + { + return true; // otherwise, override this in child class + } + + public virtual bool FileBrowseAllowed() + { + // set this to true, if SUBDIRECTORIES are allowed + // (example: possible for DIRECTORY-CACHE) + return false; // otherwise, override this in child class + } + + public virtual bool SubItemsAllowed() + { + return false; + } + + public virtual bool ProfileLoadingAllowed() + { + return false; + } + + public virtual void Refresh(bool mpGuiMode) + { + // descendant classes do that! + } + + public virtual void OnInfo(GUIListItem item, ref bool isOverviewVisible, ref ProgramInfoAction modalResult, ref int selectedFileID) + { + GUIFileInfo fileInfoDialog = (GUIFileInfo)GUIWindowManager.GetWindow(ProgramUtils.ProgramInfoID); + if (null != fileInfoDialog) + { + if (item.MusicTag == null) + { + return; + } + FileItem curFile = (FileItem)item.MusicTag; + fileInfoDialog.App = this; + fileInfoDialog.File = curFile; + fileInfoDialog.IsOverviewVisible = isOverviewVisible; + fileInfoDialog.DoModal(GetID); + isOverviewVisible = fileInfoDialog.IsOverviewVisible; + modalResult = fileInfoDialog.ModalResult; + selectedFileID = fileInfoDialog.SelectedFileID; + return; + } + } + + public int AppID + { + get { return appID; } + set { appID = value; } + } + + public int FatherID + { + get { return fatherID; } + set { fatherID = value; } + } + + public string Title + { + get { return title; } + set { title = value; } + } + + public string ShortTitle + { + get { return shortTitle; } + set { shortTitle = value; } + } + + public string Filename + { + get { return filename; } + set { filename = value; } + } + + public string Arguments + { + get { return arguments; } + set { arguments = value; } + } + + public bool UseQuotes + { + get { return useQuotes; } + set { useQuotes = value; } + } + + public bool UseShellExecute + { + get { return useShellExecute; } + set { useShellExecute = value; } + } + + public bool Enabled + { + get { return enabled; } + set { enabled = value; } + } + + public ProcessWindowStyle WindowStyle + { + get { return windowStyle; } + set { windowStyle = value; } + } + + public string Startupdir + { + get { return startupDir; } + set { startupDir = value; } + } + + public string FileDirectory + { + get { return fileDirectory; } + set { fileDirectory = value; } + } + + public string ImageDirectory + { + get { return imageDirectories; } + set { SetImageDirectory(value); } + } + + private void SetImageDirectory(string value) + { + imageDirectories = value; + imageDirs = imageDirectories.Split('\r'); + for (int i = 0; i < imageDirs.Length; i++) + { + imageDirs[i] = imageDirs[i].Trim(); + // hack the \n away.... + imageDirs[i] = imageDirs[i].TrimStart('\n'); + // hack trailing backslashes away + imageDirs[i] = imageDirs[i].TrimEnd('\\'); + } + } + + public string Imagefile + { + get { return imageFile; } + set { imageFile = value; } + } + + public string Source + { + get { return sourceFile; } + set { sourceFile = value; } + } + + public myProgSourceType SourceType + { + get { return sourceType; } + set { sourceType = value; } + } + + public string ValidExtensions + { + get { return validExtensions; } + set { validExtensions = value; } + } + + public bool ImportValidImagesOnly + { + get { return importValidImagesOnly; } + set { importValidImagesOnly = value; } + } + + public int Position + { + get { return appPosition; } + set { appPosition = value; } + } + + public int ContentID + { + get { return contentID; } + set { contentID = value; } + } + + public string SystemDefault + { + get { return systemDefault; } + set { systemDefault = value; } + } + + public bool WaitForExit + { + get { return waitForExit; } + set { waitForExit = value; } + } + + public bool GUIRefreshPossible + { + get { return RefreshButtonVisible(); } + } + + public bool EnableGUIRefresh + { + get { return enableGUIRefresh; } + set { enableGUIRefresh = value; } + } + + public int Pincode + { + get { return pincode; } + set { pincode = value; } + } + + public string LaunchErrorMsg + { + get { return launchErrorMsg; } + set { launchErrorMsg = value; } + } + + public string PreLaunch + { + get { return preLaunch; } + set { preLaunch = value; } + } + + public string PostLaunch + { + get { return postLaunch; } + set { postLaunch = value; } + } + + public Filelist Files + { + // load on demand.... + get + { + if (!filesAreLoaded) + { + LoadFiles(); + } + return fileList; + } + } + + public FilelinkList Filelinks + { + // load on demand.... + get + { + if (!linksAreLoaded) + { + LoadFileLinks(); + } + return fileLinks; + } + } + + private int GetNewAppID() + { + // get an unused SQL application KEY-number + if (sqlDB != null) + { + // won't work in multiuser environment :) + SQLiteResultSet results; + int res = 0; + results = sqlDB.Execute("SELECT MAX(APPID) FROM application"); + SQLiteResultSet.Row arr = results.Rows[0]; + if (arr.fields[0] != null) + { + if (arr.fields[0] != "") + { + res = Int32.Parse(arr.fields[0]); + } + } + return res + 1; + } + else return -1; + } + + private void Insert() + { + if (sqlDB != null) + { + try + { + if (ContentID <= 0) + { + ContentID = 100; + } + AppID = GetNewAppID(); // important to avoid subsequent inserts! + string sql = String.Format("insert into application (appid, fatherID, title, shorttitle, filename, arguments, windowstyle, startupdir, useshellexecute, usequotes, source_type, source, imagefile, filedirectory, imagedirectory, validextensions, importvalidimagesonly, iposition, enabled, enableGUIRefresh, GUIRefreshPossible, pincode, contentID, systemDefault, WaitForExit, preLaunch, postLaunch) values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}', '{14}', '{15}', '{16}', '{17}', '{18}', '{19}', '{20}', '{21}', '{22}', '{23}', '{24}', '{25}', '{26}')", + AppID, FatherID, ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), + ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), + ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.SourceTypeToStr(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), + ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, + ProgramUtils.BooleanToStr(Enabled), ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), Pincode, + ContentID, ProgramUtils.Encode(SystemDefault), ProgramUtils.BooleanToStr(WaitForExit), ProgramUtils.Encode(PreLaunch), ProgramUtils.Encode(PostLaunch) + ); + sqlDB.Execute(sql); + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + } + } + + private void Update() + { + string sql = ""; + if ((AppID >= 0) && (sqlDB != null)) + { + if (ContentID <= 0) + { + ContentID = 100; + } + try + { + sql = String.Format("update application set title = '{0}', shorttitle = '{1}', filename = '{2}', arguments = '{3}', windowstyle = '{4}', startupdir = '{5}', useshellexecute = '{6}', usequotes = '{7}', source_type = '{8}', source = '{9}', imagefile = '{10}',filedirectory = '{11}',imagedirectory = '{12}',validextensions = '{13}',importvalidimagesonly = '{14}',iposition = {15}, enabled = '{16}', fatherID = '{17}', enableGUIRefresh = '{18}', GUIRefreshPossible = '{19}', pincode = '{20}', contentID = '{21}', systemDefault = '{22}', WaitForExit = '{23}', preLaunch = '{24}', postLaunch = '{25}' where appID = {26}", + ProgramUtils.Encode(Title), ProgramUtils.Encode(ShortTitle), ProgramUtils.Encode(Filename), ProgramUtils.Encode(Arguments), + ProgramUtils.WindowStyleToStr(WindowStyle), ProgramUtils.Encode(Startupdir), ProgramUtils.BooleanToStr(UseShellExecute), + ProgramUtils.BooleanToStr(UseQuotes), ProgramUtils.SourceTypeToStr(SourceType), ProgramUtils.Encode(Source), ProgramUtils.Encode(Imagefile), + ProgramUtils.Encode(FileDirectory), ProgramUtils.Encode(ImageDirectory), ProgramUtils.Encode(ValidExtensions), ProgramUtils.BooleanToStr(importValidImagesOnly), Position, + ProgramUtils.BooleanToStr(Enabled), FatherID, ProgramUtils.BooleanToStr(EnableGUIRefresh), ProgramUtils.BooleanToStr(GUIRefreshPossible), + Pincode, ContentID, ProgramUtils.Encode(SystemDefault), ProgramUtils.BooleanToStr(WaitForExit), ProgramUtils.Encode(PreLaunch), ProgramUtils.Encode(PostLaunch), + AppID); + sqlDB.Execute(sql); + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + Log.Info("sql \n{0}", sql); + } + } + } + + public void Delete() + { + if ((AppID >= 0) && (sqlDB != null)) + { + try + { + DeleteFiles(); + DeleteFileLinks(); + sqlDB.Execute(String.Format("delete from application where appid = {0}", AppID)); + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + } + } + + public bool FirstImageDirectoryValid() + { + if (this.imageDirs.Length == 0) + { + return false; + } + else + { + string firstDirectory = imageDirs[0]; + if (firstDirectory == "") + { + return false; + } + else + { + return System.IO.Directory.Exists(firstDirectory); + } + } + + } + + protected void DeleteFiles() + { + if ((AppID >= 0) && (sqlDB != null)) + { + try + { + sqlDB.Execute(String.Format("delete from tblfile where appid = {0}", AppID)); + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + } + } + + protected void DeleteFileLinks() + { + if ((AppID >= 0) && (sqlDB != null)) + { + try + { + sqlDB.Execute(String.Format("delete from filteritem where appid = {0} or grouperappid = {0}", AppID)); + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + } + } + + public virtual void LoadFiles() + { + if (sqlDB != null) + { + // load Files and fill Files-arraylist here! + if (fileList == null) + { + fileList = new Filelist(sqlDB); + } + else + { + fileList.Clear(); + } + lastFilepath = ""; + fileList.Load(AppID, ""); + filesAreLoaded = true; + } + } + + public virtual void LoadFileLinks() + { + if (sqlDB != null) + { + if (fileLinks == null) + { + fileLinks = new FilelinkList(sqlDB); + } + else + { + fileLinks.Clear(); + } + lastFilepath = ""; + fileLinks.Load(AppID, ""); + linksAreLoaded = true; + } + } + + protected virtual void FixFileLinks() + { + // after a import the appitem has completely new + // fileitems (new ids) and LINKS stored in filteritems + // are out of sync... fix this here! + + // query with data to fix + string sqlSelectDataToFix = String.Format("select fi.appid, fi.fileid as oldfileid, f.fileid as newfileid, fi.filename as filename from filteritem fi, tblfile f where fi.appID = f.appid and fi.filename = f.filename and fi.appID = {0}", AppID); + + // update command to fix one single link + string sqlFixOneLink = "update filteritem set fileID = {0}, tag = 0 where appID = {1} and filename = '{2}'"; + + SQLiteResultSet rows2fix; + + + try + { + // 1) initialize TAG + sqlDB.Execute(String.Format("update filteritem set tag = 1234 where appid = {0}", AppID)); + + // 2) fix all fileids of the newly imported files + rows2fix = sqlDB.Execute(sqlSelectDataToFix); + int newFileID; + string filenameToFix; + if (rows2fix.Rows.Count == 0) return; + for (int row = 0; row < rows2fix.Rows.Count; row++) + { + newFileID = ProgramUtils.GetIntDef(rows2fix, row, "newfileid", -1); + filenameToFix = ProgramUtils.Get(rows2fix, row, "filename"); + sqlDB.Execute(String.Format(sqlFixOneLink, newFileID, AppID, ProgramUtils.Encode(filenameToFix))); + } + + // 3) delete untouched links ( they were not imported anymore ) + sqlDB.Execute(String.Format("delete from filteritem where appid = {0} and tag = 1234", AppID)); + + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception (AppItem.FixFileLinks) err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + + } + + public void Write() + { + if (appID == -1) + { + Insert(); + } + else + { + Update(); + } + } + + public virtual string CurrentFilePath() + { + return this.FileDirectory; + } + + public void Assign(AppItem sourceApp) + { + this.Enabled = sourceApp.Enabled; + this.AppID = sourceApp.AppID; + this.FatherID = sourceApp.FatherID; + this.Title = sourceApp.Title; + this.ShortTitle = sourceApp.ShortTitle; + this.Filename = sourceApp.Filename; + this.Arguments = sourceApp.Arguments; + this.WindowStyle = sourceApp.WindowStyle; + this.Startupdir = sourceApp.Startupdir; + this.UseShellExecute = sourceApp.UseShellExecute; + this.UseQuotes = sourceApp.UseQuotes; + this.SourceType = sourceApp.SourceType; + this.Source = sourceApp.Source; + this.Imagefile = sourceApp.Imagefile; + this.FileDirectory = sourceApp.FileDirectory; + this.ImageDirectory = sourceApp.ImageDirectory; + this.ValidExtensions = sourceApp.ValidExtensions; + this.ImportValidImagesOnly = sourceApp.ImportValidImagesOnly; + this.Position = sourceApp.Position; + this.EnableGUIRefresh = sourceApp.EnableGUIRefresh; + this.Pincode = sourceApp.Pincode; + this.WaitForExit = sourceApp.WaitForExit; + this.PreLaunch = sourceApp.PreLaunch; + this.PostLaunch = sourceApp.PostLaunch; + this.SystemDefault = sourceApp.SystemDefault; + this.ContentID = sourceApp.ContentID; + } + + public bool CheckPincode() + { + bool res = true; + if (this.Pincode > 0) + { + res = false; + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GET_PASSWORD, 0, 0, 0, 0, 0, 0); + GUIWindowManager.SendMessage(msg); + int enteredPincode = -1; + try + { + enteredPincode = Int32.Parse(msg.Label); + } + catch (Exception) + { + res = false; + } + res = (enteredPincode == this.Pincode); + } + return res; + } + + // imagedirectory stuff + // get next imagedirectory that holds at least one image for a fileitem + // * m_pFile: the file we're looking images for + private void GetNextThumbFolderIndex(FileItem fileItem) + { + if (fileItem == null) return; + bool foundThumb = false; + while (!foundThumb) + { + thumbFolderIndex++; + if (thumbFolderIndex >= imageDirs.Length) + { + thumbFolderIndex = -1; + foundThumb = true; + } + else + { + string candFolder = imageDirs[thumbFolderIndex]; + string candThumb = candFolder + "\\" + fileItem.ExtractImageFileNoPath(); + if (candThumb.ToLower() != fileItem.Imagefile.ToLower()) + { + foundThumb = (System.IO.File.Exists(candThumb)); + } + else + { + // skip the initial directory, in case it's reentered as a search directory! + foundThumb = false; + } + } + } + } + + public virtual string GetCurThumb(GUIListItem item) + { + if (item.MusicTag == null) + { + return ""; + } + if (item.MusicTag is FileItem) + { + FileItem curFile = item.MusicTag as FileItem; + return GetCurThumb(curFile); + } + else if (item.MusicTag is AppItem) + { + AppItem curApp = item.MusicTag as AppItem; + return curApp.Imagefile; + } + else + { + return ""; + } + } + + public string GetCurThumb(FileItem fileItem) + { + string curThumb = ""; + if (thumbFolderIndex == -1) + { + curThumb = fileItem.Imagefile; + } + else + { + string curFolder = imageDirs[thumbFolderIndex]; + curThumb = curFolder + "\\" + fileItem.ExtractImageFileNoPath(); + } + if (thumbIndex > 0) + { + // try to find another thumb.... + // use the myGames convention: + // every thumb has the postfix "_1", "_2", etc with the same file extension + string curExtension = fileItem.ExtractImageExtension(); + if (curThumb != "") + { + string cand = curThumb.Replace(curExtension, "_" + thumbIndex.ToString() + curExtension); + if (System.IO.File.Exists(cand)) + { + // found another thumb => override the filename! + curThumb = cand; + } + else + { + thumbIndex = 0; // restart at the first thumb! + GetNextThumbFolderIndex(fileItem); + } + } + } + return curThumb; + } + + public void ResetThumbs() + { + thumbIndex = 0; + thumbFolderIndex = -1; + } + + public void NextThumb() + { + thumbIndex++; + } + + public void LoadFromXmlProfile(XmlNode node) + { + XmlNode titleNode = node.SelectSingleNode("title"); + if (titleNode != null) + { + this.Title = titleNode.InnerText; + } + + XmlNode launchingAppNode = node.SelectSingleNode("launchingApplication"); + if (launchingAppNode != null) + { + this.Filename = launchingAppNode.InnerText; + } + + XmlNode useShellExecuteNode = node.SelectSingleNode("useShellExecute"); + if (useShellExecuteNode != null) + { + this.UseShellExecute = ProgramUtils.StrToBoolean(useShellExecuteNode.InnerText); + } + + XmlNode argumentsNode = node.SelectSingleNode("arguments"); + if (argumentsNode != null) + { + this.Arguments = argumentsNode.InnerText; + } + + XmlNode windowStyleNode = node.SelectSingleNode("windowStyle"); + if (windowStyleNode != null) + { + this.WindowStyle = ProgramUtils.StringToWindowStyle(windowStyleNode.InnerText); + } + + XmlNode startupDirNode = node.SelectSingleNode("startupDir"); + if (startupDirNode != null) + { + this.Startupdir = startupDirNode.InnerText; + } + + XmlNode useQuotesNode = node.SelectSingleNode("useQuotes"); + if (useQuotesNode != null) + { + this.UseQuotes = ProgramUtils.StrToBoolean(useQuotesNode.InnerText); + } + + XmlNode fileExtensioneNode = node.SelectSingleNode("fileextensions"); + if (fileExtensioneNode != null) + { + this.ValidExtensions = fileExtensioneNode.InnerText; + } + } + + public string CurrentView + { + get { return _currentView; } + set { _currentView = value; } + } + } +} \ No newline at end of file Added: trunk/plugins/MyPrograms/ApplicationItems/AppItemGamebase.cs =================================================================== --- trunk/plugins/MyPrograms/ApplicationItems/AppItemGamebase.cs (rev 0) +++ trunk/plugins/MyPrograms/ApplicationItems/AppItemGamebase.cs 2008-03-30 22:39:00 UTC (rev 1569) @@ -0,0 +1,133 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; + +using SQLite.NET; + +namespace MediaPortal.GUI.GUIPrograms +{ + /// <summary> + /// Summary description for AppItemGamebase. + /// </summary> + public class AppItemGamebase: AppItem + { + GUIDialogProgress pDlgProgress = null; + + public AppItemGamebase(SQLiteClient initSqlDB): base(initSqlDB) + { + // nothing to create here... + } + + private void ShowProgressDialog() + { + pDlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_PROGRESS); + pDlgProgress.Reset(); + pDlgProgress.ShowWaitCursor = true; + pDlgProgress.SetHeading(GUILocalizeStrings.Get(13015)); + pDlgProgress.SetLine(0, GUILocalizeStrings.Get(13015)); + pDlgProgress.SetLine(1, ""); + pDlgProgress.SetLine(2, ""); + pDlgProgress.StartModal(GetID); + pDlgProgress.ShowProgressBar(true); + pDlgProgress.Progress(); + } + + private void DoGamebaseImport(bool bGUIMode) + { + if (sqlDB == null) + return ; + if (this.AppID < 0) + return ; + if ((this.SourceType != myProgSourceType.GAMEBASE) || (Source == "") || (!File.Exists(Source))) + return ; + // show progress dialog and run the import... + if (bGUIMode) + { + ShowProgressDialog(); + } + try + { + MyGamebaseImporter objImporter = new MyGamebaseImporter(this, sqlDB); + objImporter.OnReadNewFile += new MyGamebaseImporter.GamebaseEventHandler(ReadNewFile); + try + { + objImporter.Start(); + } + finally + { + objImporter.OnReadNewFile -= new MyGamebaseImporter.GamebaseEventHandler(ReadNewFile); + } + } + finally + { + if (bGUIMode) + { + pDlgProgress.Close(); + } + } + } + + private void ReadNewFile(string strFileName, int curPos, int maxPos) + { + if (pDlgProgress != null) + { + pDlgProgress.SetLine(2, String.Format("{0} {1}", GUILocalizeStrings.Get(13005), strFileName)); // "last imported file {0}" + if ((curPos > 0) && (maxPos > 0)) + { + int perc = 100 * curPos / maxPos; + pDlgProgress.SetPercentage(perc); + } + pDlgProgress.Progress(); + } + SendRefreshInfo(String.Format("{0} {1}", GUILocalizeStrings.Get(13005), strFileName)); + } + + override public bool RefreshButtonVisible() + { + return true; + } + + override public bool ProfileLoadingAllowed() + { + return true; + } + + override public void Refresh(bool bGUIMode) + { + base.Refresh(bGUIMode); + DeleteFiles(); + DoGamebaseImport(bGUIMode); + FixFileLinks(); + LoadFiles(); + } + + + + } +} Added: trunk/plugins/MyPrograms/ApplicationItems/AppList.cs =================================================================== --- trunk/plugins/MyPrograms/ApplicationItems/AppList.cs (rev 0) +++ trunk/plugins/MyPrograms/ApplicationItems/AppList.cs 2008-03-30 22:39:00 UTC (rev 1569) @@ -0,0 +1,179 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System.Collections; +using MediaPortal.GUI.Library; + +using SQLite.NET; + +namespace MediaPortal.GUI.GUIPrograms +{ + /// <summary> + /// Summary description for Applist. + /// </summary> + public class Applist: ArrayList + { + public static SQLiteClient sqlDB = null; + static ApplicationFactory appFactory = ApplicationFactory.AppFactory; + + public static event AppItem.FilelinkLaunchEventHandler OnLaunchFilelink = null; + + public Applist(SQLiteClient initSqlDB, AppItem.FilelinkLaunchEventHandler curHandler) + { + // constructor: save SQLiteDB object and load list from DB + sqlDB = initSqlDB; + OnLaunchFilelink += curHandler; + LoadAll(); + } + + private static AppItem DBGetApp(SQLiteResultSet results, int recordIndex) + { + AppItem newApp = appFactory.GetAppItem(sqlDB, ProgramUtils.GetSourceType(results, recordIndex, "source_type")); + newApp.OnLaunchFilelink += new AppItem.FilelinkLaunchEventHandler(LaunchFilelink); + newApp.Enabled = ProgramUtils.GetBool(results, recordIndex, "enabled"); + newApp.AppID = ProgramUtils.GetIntDef(results, recordIndex, "appid", - 1); + newApp.FatherID = ProgramUtils.GetIntDef(results, recordIndex, "fatherID", - 1); + newApp.Title = ProgramUtils.Get(results, recordIndex, "title"); + newApp.ShortTitle = ProgramUtils.Get(results, recordIndex, "shorttitle"); + newApp.Filename = ProgramUtils.Get(results, recordIndex, "filename"); + newApp.Arguments = ProgramUtils.Get(results, recordIndex, "arguments"); + newApp.WindowStyle = ProgramUtils.GetProcessWindowStyle(results, recordIndex, "windowstyle"); + newApp.Startupdir = ProgramUtils.Get(results, recordIndex, "startupdir"); + newApp.UseShellExecute = ProgramUtils.GetBool(results, recordIndex, "useshellexecute"); + newApp.UseQuotes = ProgramUtils.GetBool(results, recordIndex, "usequotes"); + newApp.SourceType = ProgramUtils.GetSourceType(results, recordIndex, "source_type"); + newApp.Source = ProgramUtils.Get(results, recordIndex, "source"); + newApp.Imagefile = ProgramUtils.Get(results, recordIndex, "imagefile"); + newApp.FileDirectory = ProgramUtils.Get(results, recordIndex, "filedirectory"); + newApp.ImageDirectory = ProgramUtils.Get(results, recordIndex, "imagedirectory"); + newApp.ValidExtensions = ProgramUtils.Get(results, recordIndex, "validextensions"); + newApp.ImportValidImagesOnly = ProgramUtils.GetBool(results, recordIndex, "importvalidimagesonly"); + newApp.Position = ProgramUtils.GetIntDef(results, recordIndex, "iposition", 0); + newApp.EnableGUIRefresh = ProgramUtils.GetBool(results, recordIndex, "enableGUIRefresh"); + newApp.ContentID = ProgramUtils.GetIntDef(results, recordIndex, "contentID", 100); + newApp.SystemDefault = ProgramUtils.Get(results, recordIndex, "systemdefault"); + newApp.WaitForExit = ProgramUtils.GetBool(results, recordIndex, "waitforexit"); + newApp.Pincode = ProgramUtils.GetIntDef(results, recordIndex, "pincode", - 1); + newApp.PreLaunch = ProgramUtils.Get(results, recordIndex, "preLaunch"); + newApp.PostLaunch = ProgramUtils.Get(results, recordIndex, "postLaunch"); + return newApp; + } + + public ArrayList appsOfFatherID(int FatherID) + { + ArrayList res = new ArrayList(); + foreach (AppItem curApp in this) + { + if (curApp.FatherID == FatherID) + { + res.Add(curApp); + } + } + return res; + } + + public ArrayList appsOfFather(AppItem father) + { + if (father == null) + { + return appsOfFatherID( - 1); // return children of root node! + } + else + { + return appsOfFatherID(father.AppID); + } + } + + + public AppItem GetAppByID(int targetAppID) + { + foreach (AppItem curApp in this) + { + if (curApp.AppID == targetAppID) + { + return curApp; + } + } + return null; + } + + public AppItem CloneAppItem(AppItem sourceApp) + { + AppItem newApp = appFactory.GetAppItem(sqlDB, sourceApp.SourceType); + newApp.Assign(sourceApp); + newApp.AppID = - 1; // to force a sql INSERT when written + Add(newApp); + return newApp; + } + + + static void LaunchFilelink(FilelinkItem curLink, bool mpGuiMode) + { + OnLaunchFilelink(curLink, mpGuiMode); + } + + + public int GetMaxPosition(int fatherID) + { + int res = 0; + foreach (AppItem curApp in this) + { + if ((curApp.FatherID == fatherID) && (curApp.Position > res)) + { + res = curApp.Position; + } + } + return res; + + } + + public void LoadAll() + { + if (sqlDB == null) + return ; + try + { + Clear(); + if (null == sqlDB) + return ; + SQLiteResultSet results; + results = sqlDB.Execute("select * from application order by iposition"); + if (results.Rows.Count == 0) + return ; + for (int row = 0; row < results.Rows.Count; row++) + { + AppItem curApp = DBGetApp(results, row); + Add(curApp); + } + } + catch (SQLiteException ex) + { + Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); + } + } + + } + +} Added: trunk/plugins/MyPrograms/ApplicationItems/ApplicationFactory.cs =================================================================== --- trunk/plugins/MyPrograms/ApplicationItems/ApplicationFactory.cs (rev 0) +++ trunk/plugins/MyPrograms/ApplicationItems/ApplicationFactory.cs 2008-03-30 22:39:00 UTC (rev 1569) @@ -0,0 +1,84 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using SQLite.NET; + +namespace MediaPortal.GUI.GUIPrograms +{ + /// <summary> + /// Factory object that creates the matchin AppItem descendant class + /// depending on the sourceType parameter + /// Descendant classes differ in LOADING and REFRESHING filelists + /// </summary> + public class ApplicationFactory + { + public static ApplicationFactory AppFactory = new ApplicationFactory(); + + // singleton. Dont allow any instance of this class + private ApplicationFactory(){} + + static ApplicationFactory() + { + // nothing to create...... + } + + public AppItem GetAppItem(SQLiteClient sqlDB, myProgSourceType sourceType) + { + AppItem res = null; + switch (sourceType) + { + case myProgSourceType.DIRBROWSE: + res = new appItemDirBrowse(sqlDB); + break; + case myProgSourceType.DIRCACHE: + res = new appItemDirCache(sqlDB); + break; + case myProgSourceType.MYFILEINI: + res = new appItemMyFileINI(sqlDB); + break; + case myProgSourceType.MYFILEMEEDIO: + res = new appItemMyFileMLF(sqlDB); + break; + case myProgSourceType.MAMEDIRECT: + res = new appItemMameDirect(sqlDB); + break; + case myProgSourceType.FILELAUNCHER: + res = new appFilesEdit(sqlDB); + break; + case myProgSourceType.GROUPER: + res = new appGrouper(sqlDB); + break; + case myProgSourceType.GAMEBASE: + res = new AppItemGamebase(sqlDB); + break; + case myProgSourceType.APPEXEC: + res = new appItemAppExec(sqlDB); + break; + } + return res; + } + + } +} Added: trunk/plugins/MyPrograms/ApplicationItems/MyFileIniImporter.cs =================================================================== --- trunk/plugins/MyPrograms/ApplicationItems/MyFileIniImporter.cs (rev 0) +++ trunk/plugins/MyPrograms/ApplicationItems/MyFileIniImporter.cs 2008-03-30 22:39:00 UTC (rev 1569) @@ -0,0 +1,332 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections; +using System.IO; + +using SQLite.NET; + +names... [truncated message content] |
From: <an...@us...> - 2008-03-31 05:10:13
|
Revision: 1571 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1571&view=rev Author: and-81 Date: 2008-03-30 22:10:08 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/setup-languages.nsh trunk/plugins/IR Server Suite/setup.nsi trunk/plugins/TelnetInterface/TelnetInterface.cs Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-31 05:10:08 UTC (rev 1571) @@ -495,7 +495,7 @@ process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true); process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); process.StartInfo.UseShellExecute = bool.Parse(commands[5]); - //process.PriorityClass = ProcessPriorityClass. + //process.PriorityClass = ProcessPriorityClass. bool waitForExit = bool.Parse(commands[6]); bool forceFocus = bool.Parse(commands[7]); @@ -505,12 +505,10 @@ // Give new process focus ... if (forceFocus && !process.StartInfo.CreateNoWindow && process.StartInfo.WindowStyle != ProcessWindowStyle.Hidden) { - process.WaitForInputIdle(15000); - Thread focusForcer = new Thread(new ParameterizedThreadStart(FocusForcer)); focusForcer.Name = String.Format("Focus Forcer: {0}", process.MainWindowTitle); focusForcer.IsBackground = true; - focusForcer.Start(process.MainWindowTitle); + focusForcer.Start(process); /* int attempt = 0; @@ -534,11 +532,15 @@ static void FocusForcer(object processObj) { - string title = processObj as string; + Process process = processObj as Process; - if (title == null) - throw new ArgumentException("Argument is not a string object", "processObj"); + if (process == null) + throw new ArgumentException("Argument is not a Process object", "processObj"); + process.WaitForInputIdle(15000); + + string title = process.MainWindowTitle; + IntPtr windowHandle; while ((windowHandle = Win32.FindWindowByTitle(title)) != IntPtr.Zero) Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-31 05:10:08 UTC (rev 1571) @@ -65,6 +65,7 @@ <LI>Installer: More installer improvements thanks to Chef_Koch.</LI> <LI>Installer: Added a required file for Technotrend remote.</LI> <LI>Abstract Remote Model: Corrected a bug in the Abstract Remote Map for MP Control Plugin.</LI> +<LI>Run Command: Fixed a Force Focus bug.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/setup-languages.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup-languages.nsh 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/setup-languages.nsh 2008-03-31 05:10:08 UTC (rev 1571) @@ -31,19 +31,21 @@ # ENGLISH LangString DESC_SectionInputService ${LANG_ENGLISH} "A windows service that provides access to your IR devices." +LangString DESC_SectionGroupMP ${LANG_ENGLISH} "MediaPortal plugins." LangString DESC_SectionMPControlPlugin ${LANG_ENGLISH} "Connects to the Input Service to control MediaPortal." LangString DESC_SectionMPBlastZonePlugin ${LANG_ENGLISH} "Lets you control your IR devices from within the MediaPortal GUI." LangString DESC_SectionTV2BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." +LangString DESC_SectionGroupTV3 ${LANG_ENGLISH} "MediaPortal TV Server plugins." LangString DESC_SectionTV3BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." LangString DESC_SectionTranslator ${LANG_ENGLISH} "Control your whole PC." -LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple tray application to launch an application of your choosing when a particular button is pressed." -LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote). Also includes a Skin Editor and Smart Device versions of Virtual Remote." +LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple program to launch an application of your choosing when a particular button is pressed." +LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control. Includes PC application, web, and Smart Devices versions." LangString DESC_SectionIRBlast ${LANG_ENGLISH} "Command line tools for blasting IR codes." LangString DESC_SectionIRFileTool ${LANG_ENGLISH} "Tool for learning, modifying, testing, correcting and converting IR command files." LangString DESC_SectionKeyboardInputRelay ${LANG_ENGLISH} "Relays keyboard input to the Input Service to act on keypresses like remote buttons." LangString DESC_SectionDboxTuner ${LANG_ENGLISH} "Command line tuner for Dreambox devices." LangString DESC_SectionHcwPvrTuner ${LANG_ENGLISH} "Command line tuner for Hauppauge PVR devices." -LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Very simple testing tool for troubleshooting input and communications problems." +LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Simple testing tool for troubleshooting input and communications problems." LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" @@ -51,7 +53,7 @@ LangString TEXT_MSGBOX_REMOVE_ALL ${LANG_ENGLISH} "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework Runtime is a prerequisite. Please install first." -LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "MediaPortal requires at least Windows XP. Your Windows is not supported. Installation aborted" -LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "MediaPortal is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." +LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "$(^Name) requires at least Windows XP. Your Windows is not supported. Installation aborted" +LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." LangString TEXT_MSGBOX_ERROR_ON_UNINSTALL ${LANG_ENGLISH} "An error occured while trying to uninstall old version!$\r$\nDo you still want to continue the installation?" -LangString TEXT_MSGBOX_ERROR_REBOOT_REQUIRED ${LANG_ENGLISH} "REBOOT IS REQUIRED. DO THAT!!!!" +LangString TEXT_MSGBOX_ERROR_REBOOT_REQUIRED ${LANG_ENGLISH} "You must reboot your computer to continue the installation." Modified: trunk/plugins/IR Server Suite/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup.nsi 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/setup.nsi 2008-03-31 05:10:08 UTC (rev 1571) @@ -97,7 +97,7 @@ #!define MUI_HEADERIMAGE_RIGHT !define MUI_COMPONENTSPAGE_SMALLDESC -!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_AUTOCLOSE ;!define MUI_FINISHPAGE_RUN "$INSTDIR\Input Service Configuration\Input Service Configuration.exe" ;!define MUI_FINISHPAGE_RUN_TEXT "Input Service Configuration" @@ -1321,10 +1321,12 @@ ; Section descriptions !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SectionInputService} "$(DESC_SectionInputService)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMP} "$(DESC_SectionGroupMP)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "$(DESC_SectionTranslator)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "$(DESC_SectionTrayLauncher)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "$(DESC_SectionVirtualRemote)" Modified: trunk/plugins/TelnetInterface/TelnetInterface.cs =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-03-31 05:10:08 UTC (rev 1571) @@ -35,6 +35,8 @@ bool _processConnectionThread; + List<Socket> _activeSockets; + #endregion Variables #region IPlugin Members @@ -46,9 +48,13 @@ { _serverPort = 23; _processConnectionThread = true; - + + GUIWindowManager.Receivers += new SendMessageHandler(OnMessage); + try { + _activeSockets = new List<Socket>(); + _localEndPoint = new IPEndPoint(IPAddress.Any, _serverPort); _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); @@ -78,12 +84,19 @@ { _processConnectionThread = false; + lock (_activeSockets) + foreach (Socket socket in _activeSockets) + socket.Close(); + + if (_serverSocket != null) _serverSocket.Close(); - _serverSocket = null; - _localEndPoint = null; + _serverSocket = null; + _localEndPoint = null; _connectionThread = null; + + GUIWindowManager.Receivers -= new SendMessageHandler(OnMessage); } #endregion IPlugin Members @@ -95,14 +108,6 @@ public bool DefaultEnabled() { return true; } public string Description() { return "Provides a telnet interface to control and interact with MediaPortal"; } - /// <summary> - /// Gets the home screen details for the plugin. - /// </summary> - /// <param name="strButtonText">The button text.</param> - /// <param name="strButtonImage">The button image.</param> - /// <param name="strButtonImageFocus">The button image focus.</param> - /// <param name="strPictureImage">The picture image.</param> - /// <returns>true if the plugin can be seen, otherwise false.</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; @@ -123,6 +128,21 @@ #endregion ISetupForm Members + void OnMessage(GUIMessage msg) + { + string message = String.Format("MediaPortal Message: {0} - {1}, {2}", Enum.GetName(typeof(GUIMessage.MessageType), msg.Message), msg.Label, msg.Param1); + + SocketSendAll(message); + } + + + void SocketSendAll(string text) + { + lock (_activeSockets) + foreach (Socket socket in _activeSockets) + SocketSend(socket, text); + } + void SocketSend(Socket socket, string text) { byte[] textBytes = Encoding.ASCII.GetBytes(text + "\n\r"); @@ -138,6 +158,9 @@ Socket socket = _serverSocket.Accept(); socket.Blocking = true; + lock (_activeSockets) + _activeSockets.Add(socket); + SocketSend(socket, "MediaPortal Telnet Interface"); Thread communicationThread = new Thread(new ParameterizedThreadStart(CommunicationThread)); @@ -201,10 +224,14 @@ { Log.Error(ex); } + finally + { + lock (_activeSockets) + _activeSockets.Remove(socket); + } } - void ProcessCommand(Socket socket, string text) { string[] words = text.Split(' '); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-04 08:00:38
|
Revision: 1593 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1593&view=rev Author: and-81 Date: 2008-04-04 01:00:34 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/SetMerit/ trunk/plugins/SetMerit/SetMerit/ trunk/plugins/SetMerit/SetMerit/Program.cs trunk/plugins/SetMerit/SetMerit/Properties/ trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs trunk/plugins/SetMerit/SetMerit/SetMerit.csproj trunk/plugins/SetMerit/SetMerit.sln Added: trunk/plugins/SetMerit/SetMerit/Program.cs =================================================================== --- trunk/plugins/SetMerit/SetMerit/Program.cs (rev 0) +++ trunk/plugins/SetMerit/SetMerit/Program.cs 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,65 @@ +using System; + +using Microsoft.Win32; + +namespace SetMerit +{ + + static class Program + { + + const string FiltersKey = @"CLSID\{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance\"; + const string MeritKey = "FilterData"; + + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main(string[] args) + { + try + { + if (args.Length == 2) + { + if (args[1].Length != 8) + throw new InvalidOperationException(String.Format("Not a valid merit value \"{0}\"", args[1])); + + // Reverse the merit bytes ... + byte[] meritData = new byte[4]; + int meritByte = 3; + for (int index = 0; index < 8; index += 2) + { + string byteStr = args[1].Substring(index, 2); + + meritData[meritByte--] = byte.Parse(byteStr, System.Globalization.NumberStyles.HexNumber); + } + + string filter = FiltersKey + args[0]; + Console.WriteLine("Modifying HKCR\\{0} ...", filter); + + using (RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(filter, true)) + { + byte[] data = (byte[])regKey.GetValue(MeritKey, null); + + Array.Copy(meritData, 0, data, 4, 4); + + regKey.SetValue(MeritKey, (object)data); + } + + Console.WriteLine("Success"); + } + else + { + Console.WriteLine("Usage: SetMerit [Filter GUID] [New Merit]"); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + } + +} Added: trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SetMerit")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SetMerit")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("26f3d460-b89c-495d-9272-810e7866a3cd")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/SetMerit/SetMerit/SetMerit.csproj =================================================================== --- trunk/plugins/SetMerit/SetMerit/SetMerit.csproj (rev 0) +++ trunk/plugins/SetMerit/SetMerit/SetMerit.csproj 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,50 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{CCA6201F-72F7-4173-9D8A-C2A011767830}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SetMerit</RootNamespace> + <AssemblyName>SetMerit</AssemblyName> + <StartupObject>SetMerit.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/SetMerit/SetMerit.sln =================================================================== --- trunk/plugins/SetMerit/SetMerit.sln (rev 0) +++ trunk/plugins/SetMerit/SetMerit.sln 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,24 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetMerit", "SetMerit\SetMerit.csproj", "{CCA6201F-72F7-4173-9D8A-C2A011767830}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-04 09:23:27
|
Revision: 1597 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1597&view=rev Author: and-81 Date: 2008-04-04 02:23:24 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-04-04 09:02:48 UTC (rev 1596) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-04-04 09:23:24 UTC (rev 1597) @@ -44,7 +44,7 @@ /// <summary> /// The plugin version string. /// </summary> - internal const string PluginVersion = "MCE Replacement Plugin 1.0.4.2 for MediaPortal 0.2.3.0"; + internal const string PluginVersion = "MCE Replacement Plugin 1.4.2.0 for MediaPortal 0.2.3.0"; /// <summary> /// The wParam for Message Mode Windows Messages. Modified: trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2008-04-04 09:02:48 UTC (rev 1596) +++ trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2008-04-04 09:23:24 UTC (rev 1597) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.2")] -[assembly: AssemblyFileVersionAttribute("1.0.4.2")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersionAttribute("1.4.2.0")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs 2008-04-04 09:02:48 UTC (rev 1596) +++ trunk/plugins/TelnetInterface/Properties/AssemblyInfo.cs 2008-04-04 09:23:24 UTC (rev 1597) @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.2")] -[assembly: AssemblyFileVersion("1.0.4.2")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-04 12:43:08
|
Revision: 1602 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1602&view=rev Author: and-81 Date: 2008-04-04 05:43:01 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Updated build details for Release Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Virtual Remote (PocketPC2003).csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/Virtual Remote (PocketPC2003) Installer.vddproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Virtual Remote (WinCE5).csproj trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj trunk/plugins/IR Server Suite/Commands/Command/Command.csproj trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Commands/GeneralCommands/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/TestApp/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj trunk/plugins/IR Server Suite/Commands/VariableList/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/VariableList/VariableList.csproj trunk/plugins/IR Server Suite/Common/IrssScheduler/IrssScheduler.csproj trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj trunk/plugins/TelnetInterface/TelnetInterface.csproj Modified: trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,7 +26,8 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/LogTimeCodeExtractor/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -30,6 +30,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: NeutralResourcesLanguageAttribute("en")] Modified: trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/MacroScope/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -33,8 +33,8 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] [assembly: NeutralResourcesLanguageAttribute("en")] Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Virtual Remote (PocketPC2003).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Virtual Remote (PocketPC2003).csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Virtual Remote (PocketPC2003).csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -38,16 +38,17 @@ </DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants> + <DefineConstants>PocketPC</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <FileAlignment>512</FileAlignment> <WarningLevel>4</WarningLevel> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.WindowsCE.Forms" /> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/Virtual Remote (PocketPC2003) Installer.vddproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/Virtual Remote (PocketPC2003) Installer.vddproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/Virtual Remote (PocketPC2003) Installer.vddproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -358,7 +358,7 @@ { "{605BE39E-5046-48BD-AEC0-63C3A46626D5}:_F00D064CDFE44D93B469317FC4F5571A" { - "SourcePath" = "8:..\\Virtual Remote (PocketPC2003)\\obj\\Debug\\VirtualRemote.exe" + "SourcePath" = "8:..\\Virtual Remote (PocketPC2003)\\obj\\Release\\VirtualRemote.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_D5C3E2CA9AB34D82A1365B0FC89F89A8" Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -35,15 +35,16 @@ </DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants> + <DefineConstants>Smartphone</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <FileAlignment>512</FileAlignment> <WarningLevel>4</WarningLevel> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="mscorlib" /> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Virtual Remote (WinCE5).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Virtual Remote (WinCE5).csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Virtual Remote (WinCE5).csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -38,7 +38,7 @@ </DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE;$(PlatformFamilyName)</DefineConstants> @@ -48,6 +48,7 @@ <FileAlignment>512</FileAlignment> <WarningLevel>4</WarningLevel> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.WindowsCE.Forms" /> Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,7 +9,7 @@ [assembly: AssemblyTitle("Web Remote")] [assembly: AssemblyDescription("Web interface for Virtual Remote")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Web Remote")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Web Remote.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -28,12 +28,14 @@ </DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Commands/Command/Command.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <DocumentationFile>bin\Debug\CommandBase.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,7 +9,7 @@ [assembly: AssemblyTitle("Command")] [assembly: AssemblyDescription("IR Server Suite Command base class")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Command")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] @@ -32,7 +32,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <DocumentationFile>bin\Debug\CommandProcessor.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("Command Processor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Command Processor")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,7 +32,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("GeneralCommands")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("GeneralCommands")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,7 +32,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> Modified: trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("MediaPortalCommands")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("MediaPortalCommands")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,7 +32,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/TestApp/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/TestApp/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/TestApp/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("TestApp")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("TestApp")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -30,7 +30,7 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -21,12 +21,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Commands/VariableList/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/VariableList/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/VariableList/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,9 +9,9 @@ [assembly: AssemblyTitle("VariableList")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("VariableList")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,7 +32,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/VariableList/VariableList.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/VariableList/VariableList.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Commands/VariableList/VariableList.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Common/IrssScheduler/IrssScheduler.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssScheduler/IrssScheduler.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Common/IrssScheduler/IrssScheduler.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -22,12 +22,14 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -57,7 +57,8 @@ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <DocumentationFile> </DocumentationFile> <DebugSymbols>false</DebugSymbols> @@ -65,7 +66,7 @@ <Optimize>true</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> <DebugType>none</DebugType> <ErrorReport>prompt</ErrorReport> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -28,12 +28,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -10,7 +10,7 @@ [assembly: AssemblyTitle("FusionREMOTE Receiver")] [assembly: AssemblyDescription("IR Server plugin to support the DViCO FusionREMOTE Receiver USB device")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("FusionRemoteReceiver")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -27,7 +27,7 @@ <DocumentationFile>bin\Debug\Girder Plugin.XML</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -10,7 +10,7 @@ [assembly: AssemblyTitle("Girder Plugin")] [assembly: AssemblyDescription("IR Server plugin to support Girder 3.x plugins")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Girder Plugin")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -9,7 +9,7 @@ [assembly: AssemblyTitle("HCW Receiver")] [assembly: AssemblyDescription("IR Server plugin to support HCW Receivers")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("HcwReceiver")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -24,12 +24,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -26,12 +26,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -24,12 +24,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -25,12 +25,14 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -24,12 +24,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -23,12 +23,14 @@ <DocumentationFile>bin\Debug\MacMini Receiver.XML</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/AssemblyInfo.cs 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/AssemblyInfo.cs 2008-04-04 12:43:01 UTC (rev 1602) @@ -8,9 +8,9 @@ [assembly: AssemblyTitle("MacMini Receiver")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("MacMini Receiver")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -24,12 +24,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -23,12 +23,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -24,12 +24,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/TelnetInterface/TelnetInterface.csproj =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.csproj 2008-04-04 11:59:15 UTC (rev 1601) +++ trunk/plugins/TelnetInterface/TelnetInterface.csproj 2008-04-04 12:43:01 UTC (rev 1602) @@ -22,12 +22,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |