From: <an...@us...> - 2007-05-18 18:02:52
|
Revision: 406 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=406&view=rev Author: and-81 Date: 2007-05-18 11:02:50 -0700 (Fri, 18 May 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 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 Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -45,7 +45,10 @@ comboBoxCommands.Items.Add(Common.UITextSerial); comboBoxCommands.Items.Add(Common.UITextMessage); comboBoxCommands.Items.Add(Common.UITextKeys); - + //TODO: Add Shutdown and Reboot + comboBoxCommands.Items.Add(Common.UITextStandby); + comboBoxCommands.Items.Add(Common.UITextHibernate); + string[] irList = Common.GetIRList(true); if (irList != null && irList.Length > 0) comboBoxCommands.Items.AddRange(irList); @@ -96,6 +99,16 @@ writer.WriteAttributeString("command", Common.XmlTagKeys); writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixKeys.Length)); } + else if (item.StartsWith(Common.CmdPrefixStandby)) + { + writer.WriteAttributeString("command", Common.XmlTagStandby); + writer.WriteAttributeString("cmdproperty", String.Empty); + } + else if (item.StartsWith(Common.CmdPrefixHibernate)) + { + writer.WriteAttributeString("command", Common.XmlTagHibernate); + writer.WriteAttributeString("cmdproperty", String.Empty); + } writer.WriteEndElement(); } @@ -148,6 +161,14 @@ case Common.XmlTagKeys: listBoxMacro.Items.Add(Common.CmdPrefixKeys + commandProperty); break; + + case Common.XmlTagStandby: + listBoxMacro.Items.Add(Common.CmdPrefixStandby); + break; + + case Common.XmlTagHibernate: + listBoxMacro.Items.Add(Common.CmdPrefixHibernate); + break; } } } @@ -211,6 +232,14 @@ listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); } + else if (selected == Common.UITextStandby) + { + listBoxMacro.Items.Add(Common.CmdPrefixStandby); + } + else if (selected == Common.UITextHibernate) + { + listBoxMacro.Items.Add(Common.CmdPrefixHibernate); + } else { BlastCommand blastCommand = new BlastCommand(selected.Substring(Common.CmdPrefixBlast.Length)); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -858,6 +858,18 @@ Common.ProcessKeyCommand(commandProperty); break; } + + case Common.XmlTagStandby: + { + Application.SetSuspendState(PowerState.Suspend, true, false); + break; + } + + case Common.XmlTagHibernate: + { + Application.SetSuspendState(PowerState.Hibernate, true, false); + break; + } } } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -247,15 +247,8 @@ InConfiguration = false; - if (StartComms()) - { - Log.Debug("MPBlastZonePlugin: Connected to IR Server host \"{0}\"", ServerHost); - } - else - { - Log.Error("MPBlastZonePlugin: Failed to start local comms"); - Log.Error("MPBlastZonePlugin: IR blasting is disabled for this session"); - } + if (!StartComms()) + Log.Error("MPBlastZonePlugin: Failed to start local comms, IR blasting is disabled for this session"); if (LogVerbose) Log.Info("MPBlastZonePlugin: Started"); 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 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -231,17 +231,11 @@ if (MultiMappingEnabled) LoadMultiMappings(); - if (StartComms()) - { - Log.Debug("MPControlPlugin: Connected to IR Server host \"{0}\"", ServerHost); - RemoteButtonListener = new RemoteButtonHandler(RemoteButtonPressed); - } - else - { - Log.Error("MPControlPlugin: Failed to connect to server on host \"{0}\"", ServerHost); - Log.Error("MPControlPlugin: Remote button reception and IR blasting are disabled for this session"); - } + if (!StartComms()) + Log.Error("MPControlPlugin: Failed to start local comms, IR input and IR blasting is disabled for this session"); + RemoteButtonListener += new RemoteButtonHandler(RemoteButtonPressed); + // Load the event mapper mappings if (EventMapperEnabled) { @@ -269,6 +263,8 @@ //SystemEvents.SessionEnding -= new SessionEndingEventHandler(SystemEvents_SessionEnding); SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + RemoteButtonListener -= new RemoteButtonHandler(RemoteButtonPressed); + if (EventMapperEnabled) MapEvent(MappedEvent.MappingEvent.MediaPortal_Stop); 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 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -129,15 +129,8 @@ LoadExternalConfigs(); - if (StartComms()) - { - Log.Debug("TV2BlasterPlugin: Connected to IR Server host \"{0}\"", ServerHost); - } - else - { - Log.Error("TV2BlasterPlugin: Failed to connect to server on host \"{0}\"", ServerHost); - Log.Error("TV2BlasterPlugin: IR blasting is disabled for this session"); - } + if (!StartComms()) + Log.Error("TV2BlasterPlugin: Failed to start local comms, IR blasting is disabled for this session"); // Register with MediaPortal to receive GUI Messages ... GUIWindowManager.Receivers += new SendMessageHandler(OnMessage); 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 2007-05-16 16:18:40 UTC (rev 405) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-05-18 18:02:50 UTC (rev 406) @@ -144,15 +144,8 @@ _eventHandler = new TvServerEventHandler(events_OnTvServerEvent); events.OnTvServerEvent += _eventHandler; - if (StartComms()) - { - Log.Debug("TV3BlasterPlugin: Connected to IR Server host \"{0}\"", ServerHost); - } - else - { - Log.Error("TV3BlasterPlugin: Failed to connect to server on host \"{0}\"", ServerHost); - Log.Error("TV3BlasterPlugin: IR blasting is disabled for this session"); - } + if (!StartComms()) + Log.Error("TV3BlasterPlugin: Failed to start local comms, IR blasting is disabled for this session"); } public void Stop() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |