|
From: <che...@us...> - 2009-07-05 19:01:32
|
Revision: 2987
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2987&view=rev
Author: chef_koch
Date: 2009-07-05 19:01:22 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
removed #IF DEBUG compile time statements
Modified Paths:
--------------
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Dbox Tuner/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/HCW PVR Tuner/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast (No Window)/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR File Tool/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Server/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Keyboard Input Relay/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/MacroScope/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Tray.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Translator/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Tray Launcher/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Applications/Web Remote/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Debug.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs
trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs
trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service/Program.cs
trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service Configuration/Program.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Dbox Tuner/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Dbox Tuner/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Dbox Tuner/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -85,11 +85,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Append("Dbox Tuner.log");
LoadSettings();
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/HCW PVR Tuner/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/HCW PVR Tuner/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/HCW PVR Tuner/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -83,11 +83,7 @@
Console.WriteLine("HCW PVR Tuner");
Console.WriteLine();
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Append("Dbox Tuner.log");
if (args.Length != 1)
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -54,11 +54,7 @@
[STAThread]
private static void Main(string[] args)
{
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Append("IR Blast.log");
ShowHeader();
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast (No Window)/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -55,11 +55,7 @@
[STAThread]
private static void Main(string[] args)
{
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Append("IR Blast (No Window).log");
try
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR File Tool/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR File Tool/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR File Tool/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -38,11 +38,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("IR File Tool.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Server/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Server/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/IR Server/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -60,11 +60,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("IR Server.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Keyboard Input Relay/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Keyboard Input Relay/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Keyboard Input Relay/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -70,11 +70,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Keyboard Input Relay.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/MacroScope/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/MacroScope/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/MacroScope/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -38,11 +38,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open(Common.FolderIrssLogs + "MacroScope.log");
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -43,11 +43,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Media Center Blaster.log");
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Tray.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Tray.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Media Center Blaster/Tray.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -476,9 +476,7 @@
/// <param name="channelFull">The channel full ID.</param>
internal static void ProcessExternalCommand(string command, int channelDigit, string channelFull)
{
-#if DEBUG
IrssLog.Debug("ProcessExternalCommand(\"{0}\", {1}, {2})", command, channelDigit, channelFull);
-#endif
if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase))
{
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Translator/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Translator/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Translator/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -155,11 +155,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Translator.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Tray Launcher/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Tray Launcher/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Tray Launcher/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -46,11 +46,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Tray Launcher.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -107,11 +107,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Virtual Remote.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -38,11 +38,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Virtual Remote Skin Editor.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Applications/Web Remote/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Applications/Web Remote/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Applications/Web Remote/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -118,11 +118,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Web Remote.log");
Application.ThreadException += Application_ThreadException;
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -38,8 +38,6 @@
{
#region Debug
-#if DEBUG
-
private static void Remote(string deviceName, string code)
{
Console.WriteLine("Remote: {0}", code);
@@ -68,8 +66,6 @@
c = null;
}
-#endif
-
#endregion Debug
#region Constants
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -259,10 +259,8 @@
/// </summary>
public override void Start()
{
-#if DEBUG
DebugOpen("IgorPlug Receiver.log");
DebugWriteLine("Start()");
-#endif
if (!Detect())
throw new InvalidOperationException("IgorPlug not found");
@@ -278,9 +276,7 @@
/// </summary>
public override void Suspend()
{
-#if DEBUG
DebugWriteLine("Suspend()");
-#endif
Stop();
}
@@ -290,9 +286,7 @@
/// </summary>
public override void Resume()
{
-#if DEBUG
DebugWriteLine("Resume()");
-#endif
Start();
}
@@ -302,18 +296,14 @@
/// </summary>
public override void Stop()
{
-#if DEBUG
DebugWriteLine("Stop()");
-#endif
_readThread.Abort();
if (_readThread.IsAlive)
_readThread.Join();
-#if DEBUG
DebugClose();
-#endif
}
private void ReadThread()
@@ -553,8 +543,6 @@
#region Debug
-#if DEBUG
-
private static StreamWriter _debugFile;
/// <summary>
@@ -674,8 +662,6 @@
DebugWriteNewLine();
}
-#endif
-
#endregion Debug
// #define TEST_APPLICATION in the project properties when creating the console test app ...
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Debug.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Debug.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Debug.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -7,9 +7,7 @@
{
public partial class iMonUSBReceivers
{
-#if DEBUG
private static StreamWriter _debugFile;
-#endif
/// <summary>
/// Opens a debug output file.
@@ -17,7 +15,6 @@
/// <param name="fileName">Name of the file.</param>
private static void DebugOpen(string fileName)
{
-#if DEBUG
if (_debugFile != null) return;
try
{
@@ -30,7 +27,6 @@
{
_debugFile = null;
}
-#endif
}
/// <summary>
@@ -38,14 +34,12 @@
/// </summary>
private static void DebugClose()
{
-#if DEBUG
if (_debugFile != null)
{
_debugFile.Close();
_debugFile.Dispose();
_debugFile = null;
}
-#endif
}
/// <summary>
@@ -55,13 +49,11 @@
/// <param name="args">Formatting arguments.</param>
private static void DebugWriteLine(string line, params object[] args)
{
-#if DEBUG
if (_debugFile != null)
{
_debugFile.Write("{0:yyyy-MM-dd HH:mm:ss.ffffff} - ", DateTime.Now);
_debugFile.WriteLine(line, args);
}
-#endif
#if TEST_APPLICATION
Console.Write("{0:yyyy-MM-dd HH:mm:ss.ffffff} - ", DateTime.Now);
Console.WriteLine(line, args);
@@ -75,12 +67,10 @@
/// <param name="args">Formatting arguments.</param>
private static void DebugWrite(string text, params object[] args)
{
-#if DEBUG
if (_debugFile != null)
{
_debugFile.Write(text, args);
}
-#endif
#if TEST_APPLICATION
Console.Write(text, args);
#endif
@@ -91,12 +81,10 @@
/// </summary>
private static void DebugWriteNewLine()
{
-#if DEBUG
if (_debugFile != null)
{
_debugFile.WriteLine();
}
-#endif
#if TEST_APPLICATION
Console.WriteLine();
#endif
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -425,8 +425,6 @@
#region Debug
-#if DEBUG
-
protected static StreamWriter _debugFile;
/// <summary>
@@ -546,8 +544,6 @@
DebugWriteNewLine();
}
-#endif
-
#endregion Debug
}
}
\ No newline at end of file
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -214,7 +214,6 @@
/// </summary>
public override void Start()
{
-#if DEBUG
try
{
DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log");
@@ -222,7 +221,6 @@
DebugWriteLine("Device Guid: {0}", _deviceGuid);
DebugWriteLine("Device Path: {0}", _devicePath);
DebugWriteLine("Device Type: {0}", Enum.GetName(typeof (DeviceType), _deviceType));
-#endif
_notifyWindow = new NotifyWindow();
_notifyWindow.Create();
@@ -235,14 +233,12 @@
_notifyWindow.DeviceArrival += OnDeviceArrival;
_notifyWindow.DeviceRemoval += OnDeviceRemoval;
-#if DEBUG
}
catch
{
DebugClose();
throw;
}
-#endif
}
/// <summary>
@@ -250,9 +246,7 @@
/// </summary>
public override void Stop()
{
-#if DEBUG
DebugWriteLine("Stop()");
-#endif
try
{
@@ -266,27 +260,18 @@
StopReadThread();
CloseDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
finally
{
_notifyWindow.UnregisterDeviceArrival();
_notifyWindow.Dispose();
_notifyWindow = null;
-#if DEBUG
DebugClose();
-#endif
}
}
@@ -295,17 +280,13 @@
/// </summary>
public override void Suspend()
{
-#if DEBUG
DebugWriteLine("Suspend()");
-#endif
try
{
if (_readHandle == null)
{
-#if DEBUG
DebugWriteLine("Warning: Device is not active");
-#endif
return;
}
@@ -314,18 +295,11 @@
StopReadThread();
CloseDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
}
/// <summary>
@@ -333,17 +307,13 @@
/// </summary>
public override void Resume()
{
-#if DEBUG
DebugWriteLine("Resume()");
-#endif
try
{
if (String.IsNullOrEmpty(Find(_deviceGuid)))
{
-#if DEBUG
DebugWriteLine("Device not found");
-#endif
return;
}
@@ -356,18 +326,11 @@
StartReadThread();
InitializeDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
}
/// <summary>
@@ -378,9 +341,7 @@
/// <returns>Learn status.</returns>
public override LearnStatus Learn(int learnTimeout, out IrCode learned)
{
-#if DEBUG
DebugWriteLine("Learn()");
-#endif
learned = null;
_learningCode = new IrCode();
@@ -394,9 +355,7 @@
while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout)
Thread.Sleep(PacketTimeout);
-#if DEBUG
DebugWriteLine("End Learn");
-#endif
ReadThreadMode modeWas = _readThreadMode;
@@ -416,9 +375,7 @@
break;
case ReadThreadMode.LearningDone:
-#if DEBUG
DebugDump(_learningCode.TimingData);
-#endif
if (_learningCode.FinalizeData())
{
learned = _learningCode;
@@ -438,10 +395,8 @@
/// <param name="port">IR port to send to.</param>
public override void Send(IrCode code, int port)
{
-#if DEBUG
DebugWrite("Send(): ");
DebugDump(code.TimingData);
-#endif
// Reset device (hopefully this will stop the blaster from stalling)
//WriteSync(ResetPacket);
@@ -472,9 +427,7 @@
/// </summary>
private void InitializeDevice()
{
-#if DEBUG
DebugWriteLine("InitializeDevice()");
-#endif
WriteSync(StartPacket);
@@ -497,9 +450,7 @@
/// <returns>Raw device data.</returns>
private static byte[] DataPacket(IrCode code)
{
-#if DEBUG
DebugWriteLine("DataPacket()");
-#endif
if (code.TimingData.Length == 0)
return null;
@@ -514,9 +465,7 @@
byte duration = (byte) Math.Abs(Math.Round(time / TimingResolution));
bool pulse = (time > 0);
-#if DEBUG
DebugWrite("{0}{1}, ", pulse ? '+' : '-', duration * TimingResolution);
-#endif
while (duration > 0x7F)
{
@@ -528,9 +477,7 @@
packet.Add((byte) (pulse ? 0x80 | duration : duration));
}
-#if DEBUG
DebugWriteNewLine();
-#endif
// Insert byte count markers into packet data bytes ...
int subpackets = (int) Math.Ceiling(packet.Count / (double) 4);
@@ -616,16 +563,12 @@
if (carrier == IrCode.CarrierFrequencyUnknown)
{
carrier = IrCode.CarrierFrequencyDefault;
-#if DEBUG
DebugWriteLine("SetCarrierFrequency(): No carrier frequency specificied, using default ({0})", carrier);
-#endif
}
-#if DEBUG
else
{
DebugWriteLine("SetCarrierFrequency({0})", carrier);
}
-#endif
byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length];
SetCarrierFreqPacket.CopyTo(carrierPacket, 0);
@@ -653,15 +596,11 @@
/// </summary>
private void StartReadThread()
{
-#if DEBUG
DebugWriteLine("StartReadThread()");
-#endif
if (_readThread != null)
{
-#if DEBUG
DebugWriteLine("Read thread already started");
-#endif
return;
}
@@ -679,15 +618,11 @@
/// </summary>
private void StopReadThread()
{
-#if DEBUG
DebugWriteLine("StopReadThread()");
-#endif
if (_readThread == null)
{
-#if DEBUG
DebugWriteLine("Read thread already stopped");
-#endif
return;
}
@@ -700,17 +635,10 @@
//_readThread.Abort();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
}
-#else
- catch
- {
- // Ignore exceptions while terminating read thread
- }
-#endif
finally
{
_stopReadThread.Close();
@@ -725,15 +653,11 @@
/// </summary>
private void OpenDevice()
{
-#if DEBUG
DebugWriteLine("OpenDevice()");
-#endif
if (_readHandle != null)
{
-#if DEBUG
DebugWriteLine("Device already open");
-#endif
return;
}
@@ -764,10 +688,8 @@
_readHandle.DangerousAddRef(ref success);
if (success)
_notifyWindow.RegisterDeviceRemoval(_readHandle.DangerousGetHandle());
-#if DEBUG
else
DebugWriteLine("Warning: Failed to initialize device removal notification");
-#endif
_deviceAvailable = true;
}
@@ -777,17 +699,13 @@
/// </summary>
private void CloseDevice()
{
-#if DEBUG
DebugWriteLine("CloseDevice()");
-#endif
_deviceAvailable = false;
if (_readHandle == null && _writeHandle == null)
{
-#if DEBUG
DebugWriteLine("Device already closed");
-#endif
return;
}
@@ -813,9 +731,7 @@
/// </summary>
private void OnDeviceArrival()
{
-#if DEBUG
DebugWriteLine("OnDeviceArrival()");
-#endif
OpenDevice();
StartReadThread();
@@ -827,9 +743,7 @@
/// </summary>
private void OnDeviceRemoval()
{
-#if DEBUG
DebugWriteLine("OnDeviceRemoval()");
-#endif
StopReadThread();
CloseDevice();
@@ -904,10 +818,8 @@
packetBytes = new byte[bytesRead];
Marshal.Copy(deviceBufferPtr, packetBytes, 0, bytesRead);
-#if DEBUG
DebugWrite("Received bytes ({0}): ", bytesRead);
DebugDump(packetBytes);
-#endif
int[] timingData = null;
@@ -915,7 +827,6 @@
{
timingData = GetTimingDataFromPacket(packetBytes);
}
-#if DEBUG
else
{
double firmware = 0.0;
@@ -945,7 +856,6 @@
break;
}
}
-#endif
switch (_readThreadMode)
{
@@ -1026,7 +936,6 @@
}
}
}
-#if DEBUG
catch (ThreadInterruptedException ex)
{
DebugWriteLine(ex.Message);
@@ -1041,13 +950,6 @@
if (_readHandle != null)
CancelIo(_readHandle);
}
-#else
- catch (Exception)
- {
- if (_readHandle != null)
- CancelIo(_readHandle);
- }
-#endif
finally
{
if (deviceBufferPtr != IntPtr.Zero)
@@ -1057,9 +959,7 @@
waitHandle.Close();
}
-#if DEBUG
DebugWriteLine("Read Thread Ended");
-#endif
}
/// <summary>
@@ -1068,10 +968,8 @@
/// <param name="data">Packet to write to device.</param>
private void WriteSync(byte[] data)
{
-#if DEBUG
DebugWrite("WriteSync({0}): ", data.Length);
DebugDump(data);
-#endif
if (!_deviceAvailable)
throw new InvalidOperationException("Device not available");
@@ -1139,18 +1037,14 @@
/// <returns>Timing data.</returns>
private int[] GetTimingDataFromPacket(byte[] packet)
{
-#if DEBUG
// TODO: Remove this try/catch block once the IndexOutOfRangeException is corrected...
try
-#endif
{
-#if DEBUG
if (_decodeCarry != 0)
{
DebugWriteLine("Decode Carry EXISTS: {0}", _decodeCarry);
DebugDump(packet);
}
-#endif
List<int> timingData = new List<int>();
@@ -1180,10 +1074,8 @@
_decodeCarry = (index + bytes + 1) - packet.Length;
bytes -= _decodeCarry;
-#if DEBUG
DebugWriteLine("Decode Carry SET: {0}", _decodeCarry);
DebugDump(packet);
-#endif
}
int j;
@@ -1209,14 +1101,11 @@
if (len != 0)
timingData.Add(len * TimingResolution);
-#if DEBUG
DebugWrite("Received timing: ");
DebugDump(timingData.ToArray());
-#endif
return timingData.ToArray();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
@@ -1225,7 +1114,6 @@
return null;
}
-#endif
}
/// <summary>
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -478,7 +478,6 @@
//_legacyDevice = (int)(flags & DeviceCapabilityFlags.Legacy) != 0;
//_canFlashLed = (int)(flags & DeviceCapabilityFlags.FlashLed) != 0;
-#if DEBUG
DebugWriteLine("Device Capabilities:");
DebugWriteLine("NumTxPorts: {0}", _numTxPorts);
DebugWriteLine("NumRxPorts: {0}", structure.ReceivePorts.ToInt32());
@@ -486,7 +485,6 @@
DebugWriteLine("ReceivePort: {0}", _receivePort);
DebugWriteLine("LearnPort: {0}", _learnPort);
DebugWriteLine("DetailsFlags: {0}", structure.DetailsFlags.ToInt32());
-#endif
}
private void GetBlasters()
@@ -520,16 +518,12 @@
_txPortMask = structure.Blasters.ToInt32();
-#if DEBUG
DebugWriteLine("TxPortMask: {0}", _txPortMask);
-#endif
}
private void TransmitIR(byte[] irData, int carrier, int transmitPortMask)
{
-#if DEBUG
DebugWriteLine("TransmitIR({0} bytes, carrier: {1}, port: {2})", irData.Length, carrier, transmitPortMask);
-#endif
if (!_deviceAvailable)
throw new InvalidOperationException("Device not available");
@@ -683,12 +677,10 @@
{
try
{
-#if DEBUG
DebugOpen("MicrosoftMceTransceiver_DriverVista.log");
DebugWriteLine("Start()");
DebugWriteLine("Device Guid: {0}", _deviceGuid);
DebugWriteLine("Device Path: {0}", _devicePath);
-#endif
_notifyWindow = new NotifyWindow();
_notifyWindow.Create();
@@ -705,9 +697,7 @@
}
catch
{
-#if DEBUG
DebugClose();
-#endif
throw;
}
}
@@ -717,9 +707,7 @@
/// </summary>
public override void Stop()
{
-#if DEBUG
DebugWriteLine("Stop()");
-#endif
try
{
@@ -729,27 +717,18 @@
StopReadThread();
CloseDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
finally
{
_notifyWindow.UnregisterDeviceArrival();
_notifyWindow.Dispose();
_notifyWindow = null;
-#if DEBUG
DebugClose();
-#endif
}
}
@@ -758,9 +737,7 @@
/// </summary>
public override void Suspend()
{
-#if DEBUG
DebugWriteLine("Suspend()");
-#endif
}
/// <summary>
@@ -768,32 +745,21 @@
/// </summary>
public override void Resume()
{
-#if DEBUG
DebugWriteLine("Resume()");
-#endif
try
{
if (String.IsNullOrEmpty(Find(_deviceGuid)))
{
-#if DEBUG
DebugWriteLine("Device not found");
-#endif
return;
}
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
}
/// <summary>
@@ -804,9 +770,7 @@
/// <returns>Learn status.</returns>
public override LearnStatus Learn(int learnTimeout, out IrCode learned)
{
-#if DEBUG
DebugWriteLine("Learn()");
-#endif
RestartReadThread(ReadThreadMode.Learning);
@@ -819,9 +783,7 @@
while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout)
Thread.Sleep(PacketTimeout);
-#if DEBUG
DebugWriteLine("End Learn");
-#endif
ReadThreadMode modeWas = _readThreadMode;
@@ -840,9 +802,7 @@
break;
case ReadThreadMode.LearningDone:
-#if DEBUG
DebugDump(_learningCode.TimingData);
-#endif
if (_learningCode.FinalizeData())
{
learned = _learningCode;
@@ -862,10 +822,8 @@
/// <param name="port">IR port to send to.</param>
public override void Send(IrCode code, int port)
{
-#if DEBUG
DebugWrite("Send(): ");
DebugDump(code.TimingData);
-#endif
byte[] data = DataPacket(code);
@@ -896,9 +854,7 @@
/// </summary>
private void InitializeDevice()
{
-#if DEBUG
DebugWriteLine("InitializeDevice()");
-#endif
GetDeviceCapabilities();
GetBlasters();
@@ -911,9 +867,7 @@
/// <returns>Raw device data.</returns>
private static byte[] DataPacket(IrCode code)
{
-#if DEBUG
DebugWriteLine("DataPacket()");
-#endif
if (code.TimingData.Length == 0)
return null;
@@ -940,15 +894,11 @@
/// </summary>
private void StartReadThread(ReadThreadMode mode)
{
-#if DEBUG
DebugWriteLine("StartReadThread({0})", Enum.GetName(typeof (ReadThreadMode), mode));
-#endif
if (_readThread != null)
{
-#if DEBUG
DebugWriteLine("Read thread already started");
-#endif
return;
}
@@ -989,15 +939,11 @@
/// </summary>
private void StopReadThread()
{
-#if DEBUG
DebugWriteLine("StopReadThread()");
-#endif
if (_readThread == null)
{
-#if DEBUG
DebugWriteLine("Read thread already stopped");
-#endif
return;
}
@@ -1022,15 +968,11 @@
/// </summary>
private void OpenDevice()
{
-#if DEBUG
DebugWriteLine("OpenDevice()");
-#endif
if (_eHomeHandle != null)
{
-#if DEBUG
DebugWriteLine("Device already open");
-#endif
return;
}
@@ -1053,12 +995,10 @@
//_notifyWindow.UnregisterDeviceArrival(); // If the device is present then we don't want to monitor arrival.
_notifyWindow.RegisterDeviceRemoval(_eHomeHandle.DangerousGetHandle());
}
-#if DEBUG
else
{
DebugWriteLine("Warning: Failed to initialize device removal notification");
}
-#endif
Thread.Sleep(PacketTimeout);
// Hopefully improves compatibility with Zalman remote which times out retrieving device capabilities. (2008-01-01)
@@ -1071,17 +1011,13 @@
/// </summary>
private void CloseDevice()
{
-#if DEBUG
DebugWriteLine("CloseDevice()");
-#endif
_deviceAvailable = false;
if (_eHomeHandle == null)
{
-#if DEBUG
DebugWriteLine("Device already closed");
-#endif
return;
}
@@ -1098,9 +1034,7 @@
/// </summary>
private void OnDeviceArrival()
{
-#if DEBUG
DebugWriteLine("OnDeviceArrival()");
-#endif
OpenDevice();
InitializeDevice();
@@ -1113,9 +1047,7 @@
/// </summary>
private void OnDeviceRemoval()
{
-#if DEBUG
DebugWriteLine("OnDeviceRemoval()");
-#endif
StopReadThread();
CloseDevice();
@@ -1169,10 +1101,8 @@
int[] timingData = GetTimingDataFromPacket(packetBytes);
-#if DEBUG
DebugWrite("Received timing: ");
DebugDump(timingData);
-#endif
if (_readThreadMode == ReadThreadMode.Learning)
_learningCode.AddTimingData(timingData);
@@ -1194,14 +1124,9 @@
}
}
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
-#else
- catch (Exception)
- {
-#endif
if (_eHomeHandle != null)
CancelIo(_eHomeHandle);
@@ -1216,22 +1141,13 @@
if (_eHomeHandle != null)
StopReceive();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
}
-#else
- catch
- {
- // Ignore this exception, we're closing it down anyway.
- }
-#endif
}
-#if DEBUG
DebugWriteLine("Read Thread Ended");
-#endif
}
#endregion Implementation
Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -212,7 +212,6 @@
/// </summary>
public override void Start()
{
-#if DEBUG
try
{
DebugOpen("MicrosoftMceTransceiver_DriverXP.log");
@@ -220,7 +219,6 @@
DebugWriteLine("Device Guid: {0}", _deviceGuid);
DebugWriteLine("Device Path: {0}", _devicePath);
DebugWriteLine("Device Type: {0}", Enum.GetName(typeof (DeviceType), _deviceType));
-#endif
_notifyWindow = new NotifyWindow();
_notifyWindow.Create();
@@ -233,14 +231,12 @@
_notifyWindow.DeviceArrival += OnDeviceArrival;
_notifyWindow.DeviceRemoval += OnDeviceRemoval;
-#if DEBUG
}
catch
{
DebugClose();
throw;
}
-#endif
}
/// <summary>
@@ -248,9 +244,7 @@
/// </summary>
public override void Stop()
{
-#if DEBUG
DebugWriteLine("Stop()");
-#endif
try
{
@@ -264,27 +258,18 @@
StopReadThread();
CloseDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
finally
{
_notifyWindow.UnregisterDeviceArrival();
_notifyWindow.Dispose();
_notifyWindow = null;
-#if DEBUG
DebugClose();
-#endif
}
}
@@ -293,17 +278,13 @@
/// </summary>
public override void Suspend()
{
-#if DEBUG
DebugWriteLine("Suspend()");
-#endif
try
{
if (_eHomeHandle == null)
{
-#if DEBUG
DebugWriteLine("Warning: Device is not active");
-#endif
return;
}
@@ -312,18 +293,11 @@
StopReadThread();
CloseDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
}
/// <summary>
@@ -331,17 +305,13 @@
/// </summary>
public override void Resume()
{
-#if DEBUG
DebugWriteLine("Resume()");
-#endif
try
{
if (String.IsNullOrEmpty(Find(_deviceGuid)))
{
-#if DEBUG
DebugWriteLine("Device not found");
-#endif
return;
}
@@ -354,18 +324,11 @@
StartReadThread();
InitializeDevice();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
throw;
}
-#else
- catch
- {
- throw;
- }
-#endif
}
/// <summary>
@@ -376,9 +339,7 @@
/// <returns>Learn status.</returns>
public override LearnStatus Learn(int learnTimeout, out IrCode learned)
{
-#if DEBUG
DebugWriteLine("Learn()");
-#endif
learned = null;
_learningCode = new IrCode();
@@ -392,9 +353,7 @@
while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout)
Thread.Sleep(PacketTimeout);
-#if DEBUG
DebugWriteLine("End Learn");
-#endif
ReadThreadMode modeWas = _readThreadMode;
@@ -414,9 +373,7 @@
break;
case ReadThreadMode.LearningDone:
-#if DEBUG
DebugDump(_learningCode.TimingData);
-#endif
if (_learningCode.FinalizeData())
{
learned = _learningCode;
@@ -436,10 +393,8 @@
/// <param name="port">IR port to send to.</param>
public override void Send(IrCode code, int port)
{
-#if DEBUG
DebugWrite("Send(): ");
DebugDump(code.TimingData);
-#endif
// Reset device (hopefully this will stop the blaster from stalling)
//WriteSync(ResetPacket);
@@ -470,9 +425,7 @@
/// </summary>
private void InitializeDevice()
{
-#if DEBUG
DebugWriteLine("InitializeDevice()");
-#endif
WriteSync(StartPacket);
@@ -495,9 +448,7 @@
/// <returns>Raw device data.</returns>
private static byte[] DataPacket(IrCode code)
{
-#if DEBUG
DebugWriteLine("DataPacket()");
-#endif
if (code.TimingData.Length == 0)
return null;
@@ -512,9 +463,7 @@
byte duration = (byte) Math.Abs(Math.Round(time / TimingResolution));
bool pulse = (time > 0);
-#if DEBUG
DebugWrite("{0}{1}, ", pulse ? '+' : '-', duration * TimingResolution);
-#endif
while (duration > 0x7F)
{
@@ -526,9 +475,7 @@
packet.Add((byte) (pulse ? 0x80 | duration : duration));
}
-#if DEBUG
DebugWriteNewLine();
-#endif
// Insert byte count markers into packet data bytes ...
int subpackets = (int) Math.Ceiling(packet.Count / (double) 4);
@@ -614,16 +561,12 @@
if (carrier == IrCode.CarrierFrequencyUnknown)
{
carrier = IrCode.CarrierFrequencyDefault;
-#if DEBUG
DebugWriteLine("SetCarrierFrequency(): No carrier frequency specificied, using default ({0})", carrier);
-#endif
}
-#if DEBUG
else
{
DebugWriteLine("SetCarrierFrequency({0})", carrier);
}
-#endif
byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length];
SetCarrierFreqPacket.CopyTo(carrierPacket, 0);
@@ -651,15 +594,11 @@
/// </summary>
private void StartReadThread()
{
-#if DEBUG
DebugWriteLine("StartReadThread()");
-#endif
if (_readThread != null)
{
-#if DEBUG
DebugWriteLine("Read thread already started");
-#endif
return;
}
@@ -677,15 +616,11 @@
/// </summary>
private void StopReadThread()
{
-#if DEBUG
DebugWriteLine("StopReadThread()");
-#endif
if (_readThread == null)
{
-#if DEBUG
DebugWriteLine("Read thread already stopped");
-#endif
return;
}
@@ -698,17 +633,10 @@
//_readThread.Abort();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
}
-#else
- catch
- {
- // Ignore exceptions while terminating read thread
- }
-#endif
finally
{
_stopReadThread.Close();
@@ -723,15 +651,11 @@
/// </summary>
private void OpenDevice()
{
-#if DEBUG
DebugWriteLine("OpenDevice()");
-#endif
if (_eHomeHandle != null)
{
-#if DEBUG
DebugWriteLine("Device already open");
-#endif
return;
}
@@ -751,10 +675,8 @@
_eHomeHandle.DangerousAddRef(ref success);
if (success)
_notifyWindow.RegisterDeviceRemoval(_eHomeHandle.DangerousGetHandle());
-#if DEBUG
else
DebugWriteLine("Warning: Failed to initialize device removal notification");
-#endif
_deviceAvailable = true;
}
@@ -764,17 +686,13 @@
/// </summary>
private void CloseDevice()
{
-#if DEBUG
DebugWriteLine("CloseDevice()");
-#endif
_deviceAvailable = false;
if (_eHomeHandle == null)
{
-#if DEBUG
DebugWriteLine("Device already closed");
-#endif
return;
}
@@ -791,9 +709,7 @@
/// </summary>
private void OnDeviceArrival()
{
-#if DEBUG
DebugWriteLine("OnDeviceArrival()");
-#endif
OpenDevice();
StartReadThread();
@@ -805,9 +721,7 @@
/// </summary>
private void OnDeviceRemoval()
{
-#if DEBUG
DebugWriteLine("OnDeviceRemoval()");
-#endif
StopReadThread();
CloseDevice();
@@ -883,10 +797,8 @@
packetBytes = new byte[bytesRead];
Marshal.Copy(deviceBufferPtr, packetBytes, 0, bytesRead);
-#if DEBUG
DebugWrite("Received bytes ({0}): ", bytesRead);
DebugDump(packetBytes);
-#endif
int[] timingData = null;
@@ -894,7 +806,6 @@
{
timingData = GetTimingDataFromPacket(packetBytes);
}
-#if DEBUG
else
{
double firmware = 0.0;
@@ -924,7 +835,6 @@
break;
}
}
-#endif
switch (_readThreadMode)
{
@@ -1005,7 +915,6 @@
}
}
}
-#if DEBUG
catch (ThreadInterruptedException ex)
{
DebugWriteLine(ex.Message);
@@ -1020,13 +929,6 @@
if (_eHomeHandle != null)
CancelIo(_eHomeHandle);
}
-#else
- catch (Exception)
- {
- if (_eHomeHandle != null)
- CancelIo(_eHomeHandle);
- }
-#endif
finally
{
if (deviceBufferPtr != IntPtr.Zero)
@@ -1036,9 +938,7 @@
waitHandle.Close();
}
-#if DEBUG
DebugWriteLine("Read Thread Ended");
-#endif
}
/// <summary>
@@ -1047,10 +947,8 @@
/// <param name="data">Packet to write to device.</param>
private void WriteSync(byte[] data)
{
-#if DEBUG
DebugWrite("WriteSync({0}): ", data.Length);
DebugDump(data);
-#endif
if (!_deviceAvailable)
throw new InvalidOperationException("Device not available");
@@ -1118,18 +1016,14 @@
/// <returns>Timing data.</returns>
private int[] GetTimingDataFromPacket(byte[] packet)
{
-#if DEBUG
// TODO: Remove this try/catch block once the IndexOutOfRangeException is corrected...
try
-#endif
{
-#if DEBUG
if (_decodeCarry != 0)
{
DebugWriteLine("Decode Carry EXISTS: {0}", _decodeCarry);
DebugDump(packet);
}
-#endif
List<int> timingData = new List<int>();
@@ -1159,10 +1053,8 @@
_decodeCarry = (index + bytes + 1) - packet.Length;
bytes -= _decodeCarry;
-#if DEBUG
DebugWriteLine("Decode Carry SET: {0}", _decodeCarry);
DebugDump(packet);
-#endif
}
int j;
@@ -1188,14 +1080,11 @@
if (len != 0)
timingData.Add(len * TimingResolution);
-#if DEBUG
DebugWrite("Received timing: ");
DebugDump(timingData.ToArray());
-#endif
return timingData.ToArray();
}
-#if DEBUG
catch (Exception ex)
{
DebugWriteLine(ex.ToString());
@@ -1204,7 +1093,6 @@
return null;
}
-#endif
}
/// <summary>
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -50,11 +50,7 @@
/// <param name="args">Command line parameters.</param>
private static void Main(string[] args)
{
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
try
{
Modified: trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service Configuration/Program.cs
===================================================================
--- trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service Configuration/Program.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/IR Server Suite/Input Service/Input Service Configuration/Program.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -107,11 +107,7 @@
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
-#if DEBUG
IrssLog.LogLevel = IrssLog.Level.Debug;
-#else
- IrssLog.LogLevel = IrssLog.Level.Info;
-#endif
IrssLog.Open("Input Service Configuration.log");
LoadSettings();
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -258,9 +258,9 @@
map = GetMapping(btnCode);
if (map == null)
return false;
-#if DEBUG
+
Log.Debug("{0} / {1} / {2} / {3}", map.Condition, map.ConProperty, map.Command, map.CmdProperty);
-#endif
+
Action action;
if (map.Sound != string.Empty) // && !g_Player.Playing)
Util.Utils.PlaySound(map.Sound, false, true);
@@ -275,10 +275,10 @@
{
case "ACTION": // execute Action x
Key key = new Key(map.CmdKeyChar, map.CmdKeyCode);
-#if DEBUG
+
Log.Debug("Executing: key {0} / {1} / Action: {2} / {3}", map.CmdKeyChar, map.CmdKeyCode, map.CmdProperty,
((Action.ActionType) Convert.ToInt32(map.CmdProperty)).ToString());
-#endif
+
action = new Action(key, (Action.ActionType) Convert.ToInt32(map.CmdProperty), 0, 0);
GUIGraphicsContext.OnAction(action);
break;
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2009-07-05 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -591,9 +591,7 @@
/// <param name="channelFull">The channel full ID.</param>
internal static void ProcessExternalCommand(string command, int channelDigit, string channelFull)
{
-#if DEBUG
Log.Debug("TV2BlasterPlugin: ProcessExternalCommand(\"{0}\", {1}, {2})", command, channelDigit, channelFull);
-#endif
if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase))
{
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 17:45:35 UTC (rev 2986)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TVServer plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2009-07-05 19:01:22 UTC (rev 2987)
@@ -346,10 +346,8 @@
{
TvServerEventArgs tvEvent = (TvServerEventArgs) eventArgs;
-#if DEBUG
Log.Debug("TV3BlasterPlugin: Received TV Server Event \"{0}\"",
Enum.GetName(typeof (TvServerEventType), tvEvent.EventType));
-#endif
if (tvEvent.EventType != TvServerEventType.StartZapChannel)
return;
@@ -358,10 +356,8 @@
if (analogChannel == null)
return;
-#if DEBUG
Log.Debug("TV3BlasterPlugin: Analog channel input source \"{0}\"",
Enum.GetName(typeof (AnalogChannel.VideoInputType), analogChannel.VideoSource));
-#endif
//if (analogChannel.VideoSource == AnalogChannel.VideoInputType.Tuner)
//return;
@@ -533,9 +529,7 @@
/// <param name="channelFull">The channel full ID.</param>
internal static void ProcessExternalCommand(string command, int channelDigit, string channelFull)
{
-#if DEBUG
Log.Debug("TV3BlasterPlugin: ProcessExternalCommand(\"{0}\", {1}, {2})", command, channelDigit, channelFull);
-#endif
if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase))
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|