From e1bd59b0d835296f141ea8b20a41f4c34506e3e6 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 26 Aug 2009 16:47:33 +0000 Subject: 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 --- win/C#/EncodeQueue/EncodeAndQueueHandler.cs | 35 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'win/C#/EncodeQueue') 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; } } - /// /// Adds an item to the queue. /// @@ -299,7 +298,7 @@ namespace Handbrake.EncodeQueue /// 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. /// /// The CLI Query - public void runCli(string query) + public void RunCli(string query) { try { @@ -417,7 +420,7 @@ namespace Handbrake.EncodeQueue /// /// Kill the CLI process /// - public void closeCLI() + private void CloseCLI() { hbProcess.Kill(); isEncoding = false; @@ -426,10 +429,15 @@ namespace Handbrake.EncodeQueue /// /// Perform an action after an encode. e.g a shutdown, standby, restart etc. /// - 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. /// /// - 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. /// /// - public void copyLog(string destination) + private static void CopyLog(string destination) { try { -- cgit v1.2.3