From: <che...@us...> - 2009-07-05 17:21:03
|
Revision: 2984 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2984&view=rev Author: chef_koch Date: 2009-07-05 17:21:00 +0000 (Sun, 05 Jul 2009) Log Message: ----------- removed setting for verbose logging, replaced it's if statements by Log.Debug Modified Paths: -------------- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs 2009-07-05 16:22:15 UTC (rev 2983) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs 2009-07-05 17:21:00 UTC (rev 2984) @@ -40,7 +40,6 @@ this.buttonDeleteMacro = new System.Windows.Forms.Button(); this.buttonEditMacro = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); - this.checkBoxLogVerbose = new System.Windows.Forms.CheckBox(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.checkBoxMultiMapping = new System.Windows.Forms.CheckBox(); this.checkBoxEventMapper = new System.Windows.Forms.CheckBox(); @@ -232,17 +231,6 @@ this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // - // checkBoxLogVerbose - // - this.checkBoxLogVerbose.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.checkBoxLogVerbose.Location = new System.Drawing.Point(192, 344); - this.checkBoxLogVerbose.Name = "checkBoxLogVerbose"; - this.checkBoxLogVerbose.Size = new System.Drawing.Size(120, 24); - this.checkBoxLogVerbose.TabIndex = 3; - this.checkBoxLogVerbose.Text = "&Extended logging"; - this.toolTips.SetToolTip(this.checkBoxLogVerbose, "Enable more detailed logging of plugin operations"); - this.checkBoxLogVerbose.UseVisualStyleBackColor = true; - // // checkBoxMultiMapping // this.checkBoxMultiMapping.Location = new System.Drawing.Point(8, 8); @@ -866,7 +854,6 @@ this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(592, 373); this.Controls.Add(this.checkBoxRequiresFocus); - this.Controls.Add(this.checkBoxLogVerbose); this.Controls.Add(this.buttonChangeServer); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.tabControl); @@ -909,7 +896,6 @@ private System.Windows.Forms.Button buttonDeleteMacro; private System.Windows.Forms.Button buttonEditMacro; private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.CheckBox checkBoxLogVerbose; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage tabPageIR; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2009-07-05 16:22:15 UTC (rev 2983) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2009-07-05 17:21:00 UTC (rev 2984) @@ -71,7 +71,6 @@ MessageBox.Show(this, "Failed to start local comms. IR functions temporarily disabled.", "MP Control Plugin - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - checkBoxLogVerbose.Checked = MPControlPlugin.LogVerbose; checkBoxRequiresFocus.Checked = MPControlPlugin.RequireFocus; checkBoxMultiMapping.Checked = MPControlPlugin.MultiMappingEnabled; checkBoxEventMapper.Checked = MPControlPlugin.EventMapperEnabled; @@ -800,7 +799,6 @@ private void buttonOK_Click(object sender, EventArgs e) { - MPControlPlugin.LogVerbose = checkBoxLogVerbose.Checked; MPControlPlugin.RequireFocus = checkBoxRequiresFocus.Checked; MPControlPlugin.MultiMappingEnabled = checkBoxMultiMapping.Checked; MPControlPlugin.EventMapperEnabled = checkBoxEventMapper.Checked; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2009-07-05 16:22:15 UTC (rev 2983) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2009-07-05 17:21:00 UTC (rev 2984) @@ -81,7 +81,6 @@ private static string _learnIRFilename; - private static bool _logVerbose; private static bool _mouseModeAcceleration; private static bool _mouseModeActive; @@ -118,16 +117,6 @@ } /// <summary> - /// Gets or sets a value indicating whether to log verbosely. - /// </summary> - /// <value><c>true</c> if logging is set to verbose; otherwise, <c>false</c>.</value> - internal static bool LogVerbose - { - get { return _logVerbose; } - set { _logVerbose = value; } - } - - /// <summary> /// Gets or sets a value indicating whether MediaPortal will require focus to handle input. /// </summary> /// <value><c>true</c> if requires focus; otherwise, <c>false</c>.</value> @@ -314,8 +303,7 @@ //SystemEvents.SessionEnding += new SessionEndingEventHandler(SystemEvents_SessionEnding); SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; - if (LogVerbose) - Log.Info("MPControlPlugin: Started"); + Log.Debug("MPControlPlugin: Started"); } /// <summary> @@ -340,8 +328,7 @@ for (int i = 0; i < _multiInputHandlers.Count; i++) _multiInputHandlers[i] = null; - if (LogVerbose) - Log.Info("MPControlPlugin: Stopped"); + Log.Debug("MPControlPlugin: Stopped"); } #endregion IPlugin methods @@ -428,17 +415,15 @@ _inConfiguration = true; - if (LogVerbose) - Log.Info("MPControlPlugin: ShowPlugin()"); + Log.Debug("MPControlPlugin: ShowPlugin()"); SetupForm setupForm = new SetupForm(); if (setupForm.ShowDialog() == DialogResult.OK) SaveSettings(); StopClient(); - - if (LogVerbose) - Log.Info("MPControlPlugin: ShowPlugin() - End"); + + Log.Debug("MPControlPlugin: ShowPlugin() - End"); } catch (Exception ex) { @@ -502,8 +487,7 @@ MPCommon.ShowNotifyDialog("Mouse Mode", notifyMessage, 2); - if (LogVerbose) - Log.Info("MPControlPlugin: {0}", notifyMessage); + Log.Debug("MPControlPlugin: {0}", notifyMessage); return true; } @@ -695,40 +679,36 @@ foreach (MappedKeyCode mapping in _remoteMap) { - if (mapping.KeyCode.Equals(keyCode, StringComparison.Ordinal)) + if (!mapping.KeyCode.Equals(keyCode, StringComparison.OrdinalIgnoreCase)) + continue; + + if (MultiMappingEnabled && mapping.Button == MultiMappingButton) { - if (MultiMappingEnabled && mapping.Button == MultiMappingButton) - { - ChangeMultiMapping(); + ChangeMultiMapping(); + return; + } + + if (MouseModeEnabled) + if (HandleMouseMode(mapping.Button)) return; - } - if (MouseModeEnabled) - if (HandleMouseMode(mapping.Button)) - return; + // Get & execute Mapping + bool gotMapped; + if (MultiMappingEnabled) + gotMapped = _multiInputHandlers[_multiMappingSet].MapAction((int) mapping.Button); + else + gotMapped = _defaultInputHandler.MapAction((int) mapping.Button); - // Get & execute Mapping - bool gotMapped; - if (MultiMappingEnabled) - gotMapped = _multiInputHandlers[_multiMappingSet].MapAction((int) mapping.Button); - else - gotMapped = _defaultInputHandler.MapAction((int) mapping.Button); + if (gotMapped) + Log.Debug("MPControlPlugin: Command \"{0}\" mapped to remote", mapping.Button); + else + Log.Debug("MPControlPlugin: Command \"{0}\" not mapped to remote", mapping.Button); - if (LogVerbose) - { - if (gotMapped) - Log.Debug("MPControlPlugin: Command \"{0}\" mapped to remote", mapping.Button); - else - Log.Debug("MPControlPlugin: Command \"{0}\" not mapped to remote", mapping.Button); - } - - return; - } + return; } + + Log.Debug("MPControlPlugin: keyCode \"{0}\" was not handled", keyCode); - if (LogVerbose) - Log.Info("MPControlPlugin: keyCode \"{0}\" was not handled", keyCode); - return; } @@ -798,8 +778,7 @@ private static void ReceivedMessage(IrssMessage received) { - if (LogVerbose) - Log.Debug("MPControlPlugin: Received Message \"{0}\"", received.Type); + Log.Debug("MPControlPlugin: Received Message \"{0}\"", received.Type); try { @@ -821,8 +800,7 @@ case MessageType.BlastIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - if (LogVerbose) - Log.Info("MPControlPlugin: Blast successful"); + Log.Debug("MPControlPlugin: Blast successful"); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { @@ -836,8 +814,7 @@ _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; - if (LogVerbose) - Log.Info("MPControlPlugin: Registered to IR Server"); + Log.Debug("MPControlPlugin: Registered to IR Server"); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { @@ -849,8 +826,7 @@ case MessageType.LearnIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - if (LogVerbose) - Log.Info("MPControlPlugin: Learned IR Successfully"); + Log.Debug("MPControlPlugin: Learned IR Successfully"); byte[] dataBytes = received.GetDataAsBytes(); @@ -910,8 +886,7 @@ // Show the mapping set name on screen ... string setName = MultiMaps[_multiMappingSet]; - if (LogVerbose) - Log.Info("MPControlPlugin: Multi-Mapping has cycled to \"{0}\"", setName); + Log.Debug("MPControlPlugin: Multi-Mapping has cycled to \"{0}\"", setName); MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); } @@ -939,8 +914,7 @@ // Show the mapping set name on screen ... string setName = MultiMaps[_multiMappingSet]; - if (LogVerbose) - Log.Info("MPControlPlugin: Multi-Mapping has changed to \"{0}\"", setName); + Log.Debug("MPControlPlugin: Multi-Mapping has changed to \"{0}\"", setName); MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); return; @@ -1085,8 +1059,7 @@ if (!matched) continue; - if (LogVerbose) - Log.Info("MPControlPlugin: Event Mapper - Event \"{0}\"", + Log.Debug("MPControlPlugin: Event Mapper - Event \"{0}\"", Enum.GetName(typeof (MappedEvent.MappingEvent), eventType)); try @@ -1115,8 +1088,7 @@ if (mappedEvent.MatchParam) continue; - if (LogVerbose) - Log.Info("MPControlPlugin: Event Mapper - Event \"{0}\"", + Log.Debug("MPControlPlugin: Event Mapper - Event \"{0}\"", Enum.GetName(typeof (MappedEvent.MappingEvent), eventType)); try @@ -1254,8 +1226,7 @@ /// <param name="port">Port to blast to.</param> internal static void BlastIR(string fileName, string port) { - if (LogVerbose) - Log.Debug("MPControlPlugin - BlastIR(): {0}, {1}", fileName, port); + Log.Debug("MPControlPlugin - BlastIR(): {0}, {1}", fileName, port); if (!_registered) throw new InvalidOperationException("Cannot Blast, not registered to an active Input Service"); @@ -1608,7 +1579,6 @@ { ServerHost = xmlreader.GetValueAsString("MPControlPlugin", "ServerHost", "localhost"); - LogVerbose = xmlreader.GetValueAsBool("MPControlPlugin", "LogVerbose", false); RequireFocus = xmlreader.GetValueAsBool("MPControlPlugin", "RequireFocus", true); MultiMappingEnabled = xmlreader.GetValueAsBool("MPControlPlugin", "MultiMappingEnabled", false); MultiMappingButton = @@ -1641,7 +1611,6 @@ { xmlwriter.SetValue("MPControlPlugin", "ServerHost", ServerHost); - xmlwriter.SetValueAsBool("MPControlPlugin", "LogVerbose", LogVerbose); xmlwriter.SetValueAsBool("MPControlPlugin", "RequireFocus", RequireFocus); xmlwriter.SetValueAsBool("MPControlPlugin", "MultiMappingEnabled", MultiMappingEnabled); xmlwriter.SetValue("MPControlPlugin", "MultiMappingButton", (int) MultiMappingButton); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs 2009-07-05 16:22:15 UTC (rev 2983) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs 2009-07-05 17:21:00 UTC (rev 2984) @@ -60,8 +60,6 @@ TV3BlasterPlugin.InConfiguration = true; TvBusinessLayer layer = new TvBusinessLayer(); - TV3BlasterPlugin.LogVerbose = - checkBoxLogVerbose.Checked = Convert.ToBoolean(layer.GetSetting("TV3BlasterPlugin_LogVerbose", "False").Value); TV3BlasterPlugin.ServerHost = layer.GetSetting("TV3BlasterPlugin_ServerHost", String.Empty).Value; if (String.IsNullOrEmpty(TV3BlasterPlugin.ServerHost)) @@ -95,12 +93,6 @@ TvBusinessLayer layer = new TvBusinessLayer(); Setting setting; - TV3BlasterPlugin.LogVerbose = checkBoxLogVerbose.Checked; - - setting = layer.GetSetting("TV3BlasterPlugin_LogVerbose"); - setting.Value = TV3BlasterPlugin.LogVerbose.ToString(); - setting.Persist(); - setting = layer.GetSetting("TV3BlasterPlugin_ServerHost"); setting.Value = TV3BlasterPlugin.ServerHost; setting.Persist(); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2009-07-05 16:22:15 UTC (rev 2983) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2009-07-05 17:21:00 UTC (rev 2984) @@ -72,7 +72,6 @@ private static IRServerInfo _irServerInfo = new IRServerInfo(); private static string _learnIRFilename; - private static bool _logVerbose; private static bool _registered; private static string _serverHost; @@ -87,16 +86,6 @@ } /// <summary> - /// Gets or sets a value indicating whether to log verbosely. - /// </summary> - /// <value><c>true</c> if logging is set to verbose; otherwise, <c>false</c>.</value> - internal static bool LogVerbose - { - get { return _logVerbose; } - set { _logVerbose = value; } - } - - /// <summary> /// Gets or sets a value indicating whether in configuration. /// </summary> /// <value><c>true</c> if in configuration; otherwise, <c>false</c>.</value> @@ -177,8 +166,7 @@ if (!StartClient(endPoint)) Log.Error("TV3BlasterPlugin: Failed to start local comms, IR blasting is disabled for this session"); - if (LogVerbose) - Log.Info("TV3BlasterPlugin: Started"); + Log.Debug("TV3BlasterPlugin: Started"); } /// <summary> @@ -191,8 +179,7 @@ StopClient(); - if (LogVerbose) - Log.Info("TV3BlasterPlugin: Stopped"); + Log.Debug("TV3BlasterPlugin: Stopped"); } /// <summary> @@ -273,8 +260,7 @@ private static void ReceivedMessage(IrssMessage received) { - if (LogVerbose) - Log.Debug("TV3BlasterPlugin: Received Message \"{0}\"", received.Type); + Log.Debug("TV3BlasterPlugin: Received Message \"{0}\"", received.Type); try { @@ -283,8 +269,7 @@ case MessageType.BlastIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - if (LogVerbose) - Log.Info("TV3BlasterPlugin: Blast successful"); + Log.Debug("TV3BlasterPlugin: Blast successful"); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { @@ -298,8 +283,7 @@ _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; - if (LogVerbose) - Log.Info("TV3BlasterPlugin: Registered to IR Server"); + Log.Debug("TV3BlasterPlugin: Registered to IR Server"); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { @@ -311,8 +295,7 @@ case MessageType.LearnIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - if (LogVerbose) - Log.Info("TV3BlasterPlugin: Learned IR Successfully"); + Log.Debug("TV3BlasterPlugin: Learned IR Successfully"); byte[] dataBytes = received.GetDataAsBytes(); @@ -660,8 +643,7 @@ /// <param name="port">Port to blast to.</param> internal static void BlastIR(string fileName, string port) { - if (LogVerbose) - Log.Debug("TV3BlasterPlugin - BlastIR(): {0}, {1}", fileName, port); + Log.Debug("TV3BlasterPlugin - BlastIR(): {0}, {1}", fileName, port); if (!_registered) throw new InvalidOperationException("Cannot Blast, not registered to an active Input Service"); @@ -871,7 +853,6 @@ { TvBusinessLayer layer = new TvBusinessLayer(); ServerHost = layer.GetSetting("TV3BlasterPlugin_ServerHost", "localhost").Value; - LogVerbose = Convert.ToBoolean(layer.GetSetting("TV3BlasterPlugin_LogVerbose", "False").Value); } #endregion Implementation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |