summaryrefslogtreecommitdiffstats
path: root/win/C#/EncodeQueue
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-08-26 16:47:33 +0000
committersr55 <[email protected]>2009-08-26 16:47:33 +0000
commite1bd59b0d835296f141ea8b20a41f4c34506e3e6 (patch)
tree243729e7afa7a3382b1bb5b6ba4af60b9361e63d /win/C#/EncodeQueue
parent60fae20f233b2c8c4a0576fe46f5527e9c66552a (diff)
WinGui:
- Updated Growl to 2.0.0.20 - Added 2 new options. "Growl when queue completes" and "Growl when encode completes" - Added 1 new option. "Disable Resolution Calculation for "None" and "Custom" modes." - Changed Filters dropdown menus for consistency and to match the new layout - Fixed a problem with the Destination save dialog box double appending a file extension. Also added m4v to the filer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2778 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/EncodeQueue')
-rw-r--r--win/C#/EncodeQueue/EncodeAndQueueHandler.cs35
1 files changed, 20 insertions, 15 deletions
diff --git a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
index a3f8ca6c0..6d8a2ce2f 100644
--- a/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
+++ b/win/C#/EncodeQueue/EncodeAndQueueHandler.cs
@@ -76,7 +76,6 @@ namespace Handbrake.EncodeQueue
get { return queue.Count; }
}
-
/// <summary>
/// Adds an item to the queue.
/// </summary>
@@ -299,7 +298,7 @@ namespace Handbrake.EncodeQueue
/// </summary>
public void EndEncodeJob()
{
- closeCLI();
+ CloseCLI();
}
private void startProcess(object state)
@@ -310,21 +309,25 @@ namespace Handbrake.EncodeQueue
string query = GetNextJob().Query;
WriteQueueStateToFile("hb_queue_recovery.xml"); // Update the queue recovery file
- runCli(query);
+ RunCli(query);
if (NewJobStarted != null)
NewJobStarted(this, new EventArgs());
hbProcess.WaitForExit();
- addCLIQueryToLog(query);
- copyLog(LastEncode.Destination);
+ AddCLIQueryToLog(query);
+ CopyLog(LastEncode.Destination);
hbProcess.Close();
hbProcess.Dispose();
-
+
isEncoding = false;
+ //Growl
+ if (Properties.Settings.Default.growlEncode)
+ GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done.");
+
if (CurrentJobCompleted != null)
CurrentJobCompleted(this, new EventArgs());
@@ -338,7 +341,7 @@ namespace Handbrake.EncodeQueue
QueueCompleted(this, new EventArgs());
// After the encode is done, we may want to shutdown, suspend etc.
- afterEncodeAction();
+ AfterEncodeAction();
}
#endregion
@@ -354,7 +357,7 @@ namespace Handbrake.EncodeQueue
/// Execute a HandBrakeCLI process.
/// </summary>
/// <param name="query">The CLI Query</param>
- public void runCli(string query)
+ public void RunCli(string query)
{
try
{
@@ -417,7 +420,7 @@ namespace Handbrake.EncodeQueue
/// <summary>
/// Kill the CLI process
/// </summary>
- public void closeCLI()
+ private void CloseCLI()
{
hbProcess.Kill();
isEncoding = false;
@@ -426,10 +429,15 @@ namespace Handbrake.EncodeQueue
/// <summary>
/// Perform an action after an encode. e.g a shutdown, standby, restart etc.
/// </summary>
- public void afterEncodeAction()
+ private void AfterEncodeAction()
{
isEncoding = false;
currentQuery = String.Empty;
+
+ //Growl
+ if (Properties.Settings.Default.growlQueue)
+ GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
+
// Do something whent he encode ends.
switch (Properties.Settings.Default.CompletionOption)
{
@@ -448,9 +456,6 @@ namespace Handbrake.EncodeQueue
case "Lock System":
Win32.LockWorkStation();
break;
- case "Growl Notification":
- GrowlCommunicator.Notify();
- break;
case "Quit HandBrake":
Application.Exit();
break;
@@ -463,7 +468,7 @@ namespace Handbrake.EncodeQueue
/// Append the CLI query to the start of the log file.
/// </summary>
/// <param name="query"></param>
- public void addCLIQueryToLog(string query)
+ private static void AddCLIQueryToLog(string query)
{
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
string logPath = Path.Combine(logDir, "last_encode_log.txt");
@@ -486,7 +491,7 @@ namespace Handbrake.EncodeQueue
/// if this feature is enabled in options.
/// </summary>
/// <param name="destination"></param>
- public void copyLog(string destination)
+ private static void CopyLog(string destination)
{
try
{