diff options
author | sr55 <[email protected]> | 2015-01-24 16:27:24 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-24 16:27:24 +0000 |
commit | ffc93adeaa23923c1c8b401e45cf4b155e4e99eb (patch) | |
tree | 0b6e6c014b6486048bbad453884b1978fd77ed0c /win | |
parent | 2739ba3806abcb12157a689d4c2eb258992bcb39 (diff) |
WinGui: Handle the Logging events a bit better. This will stop some of the cross scan/encode log pollution that's been occurring since libhb encode was enabled. Will need to look into a better solution as scans during an encode will still appear in the encode log and vice versa while a scan is ongoing.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6809 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs | 7 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs | 16 |
2 files changed, 10 insertions, 13 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 0ed17fb51..942644f2e 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -62,8 +62,6 @@ namespace HandBrake.ApplicationServices.Services.Encode /// </summary>
public LibEncode()
{
- HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
- HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
}
/// <summary>
@@ -96,6 +94,8 @@ namespace HandBrake.ApplicationServices.Services.Encode // Create a new HandBrake instance
// Setup the HandBrake Instance
+ HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
this.instance = HandBrakeInstanceManager.GetEncodeInstance(job.Configuration.Verbosity);
this.instance.EncodeCompleted += this.InstanceEncodeCompleted;
this.instance.EncodeProgress += this.InstanceEncodeProgress;
@@ -348,6 +348,9 @@ namespace HandBrake.ApplicationServices.Services.Encode ? new EventArgs.EncodeCompletedEventArgs(false, null, string.Empty, this.currentTask.Task.Destination)
: new EventArgs.EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Task.Destination));
+ HandBrakeUtils.MessageLogged -= this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged -= this.HandBrakeInstanceErrorLogged;
+
this.ShutdownFileWriter();
}
#endregion
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index 796ef5db5..721959a90 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -101,18 +101,7 @@ namespace HandBrake.ApplicationServices.Services.Scan public LibScan()
{
this.logging = new StringBuilder();
-
this.header = GeneralUtilities.CreateCliLogHeader();
-
- try
- {
- HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
- HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
- }
- catch (Exception)
- {
- // Do nothing.
- }
}
#region Events
@@ -226,6 +215,8 @@ namespace HandBrake.ApplicationServices.Services.Scan this.scanLog = new StreamWriter(this.dvdInfoPath);
// Create a new HandBrake Instance.
+ HandBrakeUtils.MessageLogged += this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged += this.HandBrakeInstanceErrorLogged;
this.instance = HandBrakeInstanceManager.GetScanInstance(configuraiton.Verbosity);
this.instance.ScanProgress += this.InstanceScanProgress;
this.instance.ScanCompleted += this.InstanceScanCompleted;
@@ -374,6 +365,9 @@ namespace HandBrake.ApplicationServices.Services.Scan // Do Nothing.
}
+ HandBrakeUtils.MessageLogged -= this.HandBrakeInstanceMessageLogged;
+ HandBrakeUtils.ErrorLogged -= this.HandBrakeInstanceErrorLogged;
+
// TODO -> Might be a better place to fix this.
string path = this.currentSourceScanPath;
if (this.currentSourceScanPath.Contains("\""))
|