diff options
author | sr55 <[email protected]> | 2012-10-07 19:04:49 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-10-07 19:04:49 +0000 |
commit | 6171d00692520927dc2fcc9bb43106bda15803b6 (patch) | |
tree | 3c9e846fa904ad66789d8104fe86acbbaffe034e /win/CS/HandBrake.ApplicationServices/Services | |
parent | 5a3ba3bfe9121d14a691441093f0d191d4410be5 (diff) |
WinGui: API Tidyup Part 1 of many
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5007 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
5 files changed, 15 insertions, 54 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index ced71d4eb..6a9717ef8 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -147,7 +147,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// <param name="e">
/// The EncodeProgressEventArgs.
/// </param>
- public void Invoke_encodeStatusChanged(EncodeProgressEventArgs e)
+ public void InvokeEncodeStatusChanged(EncodeProgressEventArgs e)
{
EncodeProgessStatus handler = this.EncodeStatusChanged;
if (handler != null)
@@ -162,7 +162,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// <param name="e">
/// The EncodeCompletedEventArgs.
/// </param>
- public void Invoke_encodeCompleted(EncodeCompletedEventArgs e)
+ public void InvokeEncodeCompleted(EncodeCompletedEventArgs e)
{
EncodeCompletedStatus handler = this.EncodeCompleted;
if (handler != null)
@@ -177,7 +177,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// <param name="e">
/// The EventArgs.
/// </param>
- public void Invoke_encodeStarted(EventArgs e)
+ public void InvokeEncodeStarted(EventArgs e)
{
EventHandler handler = this.EncodeStarted;
if (handler != null)
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index 49ff66bd2..18457af85 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -195,12 +195,12 @@ namespace HandBrake.ApplicationServices.Services }
// Fire the Encode Started Event
- this.Invoke_encodeStarted(EventArgs.Empty);
+ this.InvokeEncodeStarted(EventArgs.Empty);
}
catch (Exception exc)
{
encodeQueueTask.Status = QueueItemStatus.Error;
- this.Invoke_encodeCompleted(
+ this.InvokeEncodeCompleted(
new EncodeCompletedEventArgs(
false, null, "An Error occured when trying to encode this source. "));
throw;
@@ -236,35 +236,13 @@ namespace HandBrake.ApplicationServices.Services // No need to report anything to the user. If it fails, it's probably already stopped.
}
- this.Invoke_encodeCompleted(
+ this.InvokeEncodeCompleted(
exc == null
? new EncodeCompletedEventArgs(true, null, string.Empty)
: new EncodeCompletedEventArgs(false, exc, "An Unknown Error has occured when trying to Stop this encode."));
}
/// <summary>
- /// Attempt to Safely kill a DirectRun() CLI
- /// NOTE: This will not work with a MinGW CLI
- /// Note: http://www.cygwin.com/ml/cygwin/2006-03/msg00330.html
- /// </summary>
- public void SafelyStop()
- {
- if ((int)this.processHandle == 0)
- return;
-
- // Allow the CLI to exit cleanly
- Win32.SetForegroundWindow((int)this.processHandle);
- SendKeys.Send("^C");
- SendKeys.Flush();
-
- /*/if (HbProcess != null)
- //{
- // HbProcess.StandardInput.AutoFlush = true;
- // HbProcess.StandardInput.WriteLine("^c^z");
- //}*/
- }
-
- /// <summary>
/// Shutdown the service.
/// </summary>
public void Shutdown()
@@ -314,7 +292,7 @@ namespace HandBrake.ApplicationServices.Services }
this.currentTask.Status = QueueItemStatus.Completed;
- this.Invoke_encodeCompleted(new EncodeCompletedEventArgs(true, null, string.Empty));
+ this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(true, null, string.Empty));
}
/// <summary>
@@ -399,7 +377,7 @@ namespace HandBrake.ApplicationServices.Services ElapsedTime = DateTime.Now - this.startTime,
};
- this.Invoke_encodeStatusChanged(eventArgs);
+ this.InvokeEncodeStatusChanged(eventArgs);
if (this.WindowsSeven.IsWindowsSeven)
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs index eddc49d9b..915d66788 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IEncode.cs @@ -83,13 +83,6 @@ namespace HandBrake.ApplicationServices.Services.Interfaces void Stop();
/// <summary>
- /// Attempt to Safely kill a DirectRun() CLI
- /// NOTE: This will not work with a MinGW CLI
- /// Note: http://www.cygwin.com/ml/cygwin/2006-03/msg00330.html
- /// </summary>
- void SafelyStop();
-
- /// <summary>
/// Copy the log file to the desired destinations
/// </summary>
/// <param name="destination">
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs index 5c3deb80f..eb0657cba 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs @@ -160,11 +160,11 @@ namespace HandBrake.ApplicationServices.Services }
// Fire the Encode Started Event
- this.Invoke_encodeStarted(EventArgs.Empty);
+ this.InvokeEncodeStarted(EventArgs.Empty);
}
catch (Exception exc)
{
- this.Invoke_encodeCompleted(new EncodeCompletedEventArgs(false, exc, "An Error has occured."));
+ this.InvokeEncodeCompleted(new EncodeCompletedEventArgs(false, exc, "An Error has occured."));
}
}
@@ -195,23 +195,13 @@ namespace HandBrake.ApplicationServices.Services // Do Nothing.
}
- this.Invoke_encodeCompleted(
+ this.InvokeEncodeCompleted(
exc == null
? new EncodeCompletedEventArgs(true, null, string.Empty)
: new EncodeCompletedEventArgs(false, exc, "An Error has occured."));
}
/// <summary>
- /// Attempt to Safely kill a DirectRun() CLI
- /// NOTE: This will not work with a MinGW CLI
- /// Note: http://www.cygwin.com/ml/cygwin/2006-03/msg00330.html
- /// </summary>
- public void SafelyStop()
- {
- throw new NotImplementedException("This Method is not used in the LibEncode service. You should use the Stop() method instead! ");
- }
-
- /// <summary>
/// Shutdown the service.
/// </summary>
public void Shutdown()
@@ -281,7 +271,7 @@ namespace HandBrake.ApplicationServices.Services ElapsedTime = DateTime.Now - this.startTime,
};
- this.Invoke_encodeStatusChanged(args);
+ this.InvokeEncodeStatusChanged(args);
if (this.WindowsSeven.IsWindowsSeven)
{
@@ -305,7 +295,7 @@ namespace HandBrake.ApplicationServices.Services {
this.IsEncoding = false;
- this.Invoke_encodeCompleted(
+ this.InvokeEncodeCompleted(
e.Error
? new EncodeCompletedEventArgs(false, null, string.Empty)
: new EncodeCompletedEventArgs(true, null, string.Empty));
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index 020aaf0ad..acfb4d6d6 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -186,7 +186,7 @@ namespace HandBrake.ApplicationServices.Services {
StreamReader parseLog = new StreamReader(path);
this.readData = new Parser(parseLog.BaseStream);
- this.SouceData = Source.Parse(this.readData, this.userSettingService);
+ this.SouceData = Source.Parse(this.readData, this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav));
this.SouceData.ScanPath = path;
if (this.ScanCompleted != null)
@@ -301,7 +301,7 @@ namespace HandBrake.ApplicationServices.Services this.readData = new Parser(this.hbProc.StandardError.BaseStream);
this.readData.OnScanProgress += this.OnScanProgress;
- this.SouceData = Source.Parse(this.readData, this.userSettingService);
+ this.SouceData = Source.Parse(this.readData, this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav));
this.SouceData.ScanPath = (string)sourcePath;
// Write the Buffer out to file.
|