summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/C#/HandBrake.ApplicationServices/Functions/Win7.cs4
-rw-r--r--win/C#/HandBrake.ApplicationServices/Init.cs4
-rw-r--r--win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs24
-rw-r--r--win/C#/HandBrake.ApplicationServices/Properties/Settings.settings6
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Encode.cs446
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Queue.cs3
-rw-r--r--win/C#/HandBrake.ApplicationServices/app.config6
-rw-r--r--win/C#/Program.cs4
-rw-r--r--win/C#/Properties/Settings.Designer.cs24
-rw-r--r--win/C#/Properties/Settings.settings6
-rw-r--r--win/C#/app.config6
-rw-r--r--win/C#/frmMain.cs36
-rw-r--r--win/C#/frmOptions.Designer.cs89
-rw-r--r--win/C#/frmOptions.cs37
-rw-r--r--win/C#/frmOptions.resx16
-rw-r--r--win/C#/frmPreview.cs3
16 files changed, 255 insertions, 459 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs b/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs
index d8f522fe3..0123139ba 100644
--- a/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs
+++ b/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs
@@ -6,8 +6,6 @@
namespace HandBrake.ApplicationServices.Functions
{
using System;
-
- using Microsoft.WindowsAPICodePack;
using Microsoft.WindowsAPICodePack.Taskbar;
/// <summary>
@@ -55,7 +53,7 @@ namespace HandBrake.ApplicationServices.Functions
{
return;
}
-
+ windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal); // todo CHECK THIS
windowsTaskbar.SetProgressValue(percentage, 100);
}
diff --git a/win/C#/HandBrake.ApplicationServices/Init.cs b/win/C#/HandBrake.ApplicationServices/Init.cs
index 7fb0e902c..c8f15c3fd 100644
--- a/win/C#/HandBrake.ApplicationServices/Init.cs
+++ b/win/C#/HandBrake.ApplicationServices/Init.cs
@@ -52,14 +52,12 @@ namespace HandBrake.ApplicationServices
/// <param name="preventSleep">
/// Prevent the system from sleeping
/// </param>
- public static void SetupSettings(bool cli_minimized, string completionOption, bool disableDvdNav, bool enocdeStatusInGui,
+ public static void SetupSettings(string completionOption, bool disableDvdNav,
bool growlEncode, bool growlQueue, string processPriority, string saveLogPath, bool saveLogToSpecifiedPath,
bool saveLogWithVideo, bool showCliForInGuiEncodeStatus, bool preventSleep)
{
- Properties.Settings.Default.cli_minimized = cli_minimized;
Properties.Settings.Default.CompletionOption = completionOption;
Properties.Settings.Default.disableDvdNav = disableDvdNav;
- Properties.Settings.Default.enocdeStatusInGui = enocdeStatusInGui;
Properties.Settings.Default.growlEncode = growlEncode;
Properties.Settings.Default.growlQueue = growlQueue;
Properties.Settings.Default.processPriority = processPriority;
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs b/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs
index d835524af..42083c571 100644
--- a/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs
+++ b/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs
@@ -110,18 +110,6 @@ namespace HandBrake.ApplicationServices.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool cli_minimized {
- get {
- return ((bool)(this["cli_minimized"]));
- }
- set {
- this["cli_minimized"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool showCliForInGuiEncodeStatus {
get {
return ((bool)(this["showCliForInGuiEncodeStatus"]));
@@ -134,18 +122,6 @@ namespace HandBrake.ApplicationServices.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool enocdeStatusInGui {
- get {
- return ((bool)(this["enocdeStatusInGui"]));
- }
- set {
- this["enocdeStatusInGui"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool growlEncode {
get {
return ((bool)(this["growlEncode"]));
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings b/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings
index 96d2de89a..581684d2d 100644
--- a/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings
+++ b/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings
@@ -23,15 +23,9 @@
<Setting Name="processPriority" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
- <Setting Name="cli_minimized" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="showCliForInGuiEncodeStatus" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
- <Setting Name="enocdeStatusInGui" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="growlEncode" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
index 1731d4851..79b82a2ea 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
@@ -25,7 +25,7 @@ namespace HandBrake.ApplicationServices.Services
/// </summary>
public class Encode : IEncode
{
- /* Private Variables */
+ #region Private Variables
/// <summary>
/// An Encode Job
@@ -38,14 +38,9 @@ namespace HandBrake.ApplicationServices.Services
private StringBuilder logBuffer;
/// <summary>
- /// The line number thats been read to in the log file
+ /// The Log file writer
/// </summary>
- private int logFilePosition;
-
- /// <summary>
- /// A Timer for this window
- /// </summary>
- private Timer windowTimer;
+ private StreamWriter fileWriter;
/// <summary>
/// Gets The Process Handle
@@ -62,6 +57,8 @@ namespace HandBrake.ApplicationServices.Services
/// </summary>
private Win7 windowsSeven = new Win7();
+ #endregion
+
/* Constructor */
/// <summary>
@@ -72,7 +69,7 @@ namespace HandBrake.ApplicationServices.Services
this.EncodeStarted += Encode_EncodeStarted;
}
- /* Delegates */
+ #region Delegates and Event Handlers
/// <summary>
/// Encode Progess Status
@@ -101,6 +98,7 @@ namespace HandBrake.ApplicationServices.Services
/// Encode process has progressed
/// </summary>
public event EncodeProgessStatus EncodeStatusChanged;
+ #endregion
/* Properties */
@@ -114,8 +112,6 @@ namespace HandBrake.ApplicationServices.Services
/// </summary>
public bool IsEncoding { get; private set; }
- /* Public Methods */
-
/// <summary>
/// Gets ActivityLog.
/// </summary>
@@ -123,16 +119,17 @@ namespace HandBrake.ApplicationServices.Services
{
get
{
- if (logBuffer == null)
+ if (this.IsEncoding == false)
{
- ResetLogReader();
- ReadFile(null);
+ ReadFile(); // Read the last log file back in if it exists
}
- return logBuffer != null ? logBuffer.ToString() : string.Empty;
+ return string.IsNullOrEmpty(this.logBuffer.ToString()) ? "No log data available..." : this.logBuffer.ToString();
}
}
+ /* Public Methods */
+
/// <summary>
/// Create a preview sample video
/// </summary>
@@ -141,42 +138,7 @@ namespace HandBrake.ApplicationServices.Services
/// </param>
public void CreatePreviewSample(string query)
{
- this.Run(new Job { Query = query }, true);
- }
-
- /// <summary>
- /// Kill the CLI process
- /// </summary>
- public void Stop()
- {
- if (this.HbProcess != null)
- this.HbProcess.Kill();
-
- Process[] list = Process.GetProcessesByName("HandBrakeCLI");
- foreach (Process process in list)
- process.Kill();
-
- if (this.EncodeEnded != null)
- this.EncodeEnded(this, new EventArgs());
- }
-
- /// <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 SafelyClose()
- {
- if ((int)this.processHandle == 0)
- return;
-
- // Allow the CLI to exit cleanly
- Win32.SetForegroundWindow((int)this.processHandle);
- SendKeys.Send("^C");
- SendKeys.Flush();
-
- // HbProcess.StandardInput.AutoFlush = true;
- // HbProcess.StandardInput.WriteLine("^C");
+ this.Run(new Job { Query = query }, false);
}
/// <summary>
@@ -185,77 +147,73 @@ namespace HandBrake.ApplicationServices.Services
/// <param name="encJob">
/// The enc Job.
/// </param>
- /// <param name="requireStandardOuput">
- /// Set to True to show no window and force standard output redirect
+ /// <param name="enableLogging">
+ /// Enable Logging. When Disabled we onlt parse Standard Ouput for progress info. Standard Error log data is ignored.
/// </param>
- protected void Run(Job encJob, bool requireStandardOuput)
+ protected void Run(Job encJob, bool enableLogging)
{
this.job = encJob;
try
{
- if (Properties.Settings.Default.preventSleep)
+ IsEncoding = true;
+
+ if (enableLogging)
+ SetupLogging(encJob);
+
+ if (Settings.Default.preventSleep)
{
Win32.PreventSleep();
}
- ResetLogReader();
- IsEncoding = true;
-
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
- string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs", "last_encode_log.txt");
- string strCmdLine = String.Format(@" /C """"{0}"" {1} 2>""{2}"" """, handbrakeCLIPath, encJob.Query, logPath);
- var cliStart = new ProcessStartInfo("CMD.exe", strCmdLine);
+ ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, encJob.Query)
+ {
+ RedirectStandardOutput = true,
+ RedirectStandardError = enableLogging ? true : false,
+ UseShellExecute = false,
+ CreateNoWindow = !Settings.Default.showCliForInGuiEncodeStatus ? true : false
+ };
+
+ this.HbProcess = Process.Start(cliStart);
- if (Settings.Default.enocdeStatusInGui || requireStandardOuput)
+ if (enableLogging)
{
- cliStart.RedirectStandardOutput = true;
- cliStart.UseShellExecute = false;
- if (!Settings.Default.showCliForInGuiEncodeStatus || requireStandardOuput)
- cliStart.CreateNoWindow = true;
+ this.HbProcess.ErrorDataReceived += HbProcErrorDataReceived;
+ this.HbProcess.BeginErrorReadLine();
}
- if (Settings.Default.cli_minimized)
- cliStart.WindowStyle = ProcessWindowStyle.Minimized;
- Process[] before = Process.GetProcesses(); // Get a list of running processes before starting.
- HbProcess = Process.Start(cliStart);
- this.processID = Main.GetCliProcess(before);
-
- this.processHandle = HbProcess.MainWindowHandle; // Set the process Handle
-
- // Start the Log Monitor
- windowTimer = new Timer(new TimerCallback(ReadFile), null, 1000, 1000);
+ this.processID = HbProcess.Id;
+ this.processHandle = HbProcess.MainWindowHandle;
// Set the process Priority
- Process hbCliProcess = null;
if (this.processID != -1)
{
- hbCliProcess = Process.GetProcessById(this.processID);
- hbCliProcess.EnableRaisingEvents = true;
- hbCliProcess.Exited += new EventHandler(HbProcess_Exited);
+ this.HbProcess.EnableRaisingEvents = true;
+ this.HbProcess.Exited += HbProcess_Exited;
}
- if (hbCliProcess != null)
- switch (Settings.Default.processPriority)
- {
- case "Realtime":
- hbCliProcess.PriorityClass = ProcessPriorityClass.RealTime;
- break;
- case "High":
- hbCliProcess.PriorityClass = ProcessPriorityClass.High;
- break;
- case "Above Normal":
- hbCliProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
- break;
- case "Normal":
- hbCliProcess.PriorityClass = ProcessPriorityClass.Normal;
- break;
- case "Low":
- hbCliProcess.PriorityClass = ProcessPriorityClass.Idle;
- break;
- default:
- hbCliProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
- break;
- }
+ // Set the Process Priority
+ switch (Settings.Default.processPriority)
+ {
+ case "Realtime":
+ this.HbProcess.PriorityClass = ProcessPriorityClass.RealTime;
+ break;
+ case "High":
+ this.HbProcess.PriorityClass = ProcessPriorityClass.High;
+ break;
+ case "Above Normal":
+ this.HbProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
+ break;
+ case "Normal":
+ this.HbProcess.PriorityClass = ProcessPriorityClass.Normal;
+ break;
+ case "Low":
+ this.HbProcess.PriorityClass = ProcessPriorityClass.Idle;
+ break;
+ default:
+ this.HbProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
+ break;
+ }
// Fire the Encode Started Event
if (this.EncodeStarted != null)
@@ -263,150 +221,94 @@ namespace HandBrake.ApplicationServices.Services
}
catch (Exception exc)
{
- Main.ShowExceptiowWindow("It would appear that HandBrakeCLI has not started correctly. You should take a look at the Activity log as it may indicate the reason why.\n\nDetailed Error Information: error occured in runCli()", exc.ToString());
+ Main.ShowExceptiowWindow("It would appear that HandBrakeCLI has not started correctly."+
+ "You should take a look at the Activity log as it may indicate the reason why.\n\nDetailed Error Information: error occured in runCli()",
+ exc.ToString());
}
}
/// <summary>
- /// The HandBrakeCLI process has exited.
+ /// Kill the CLI process
/// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EventArgs.
- /// </param>
- private void HbProcess_Exited(object sender, EventArgs e)
+ public void Stop()
{
- IsEncoding = false;
-
- windowTimer.Dispose();
- ReadFile(null);
-
- if (this.EncodeEnded != null)
- this.EncodeEnded(this, new EventArgs());
-
- if (windowsSeven.IsWindowsSeven)
+ try
{
- windowsSeven.SetTaskBarProgressToNoProgress();
- }
+ if (this.HbProcess != null) this.HbProcess.Kill();
- if (Properties.Settings.Default.preventSleep)
+ Process[] list = Process.GetProcessesByName("HandBrakeCLI");
+ foreach (Process process in list)
+ process.Kill();
+ }
+ catch (Exception exc)
{
- Win32.AllowSleep();
+ Main.ShowExceptiowWindow("Unable to stop HandBrakeCLI. It may not be running.", exc.ToString());
}
+
+ if (this.EncodeEnded != null)
+ this.EncodeEnded(this, new EventArgs());
}
/// <summary>
- /// Function to run the CLI directly rather than via CMD
- /// TODO: Code to handle the Log data has yet to be written.
- /// TODO: Code to handle the % / ETA info has to be written.
+ /// 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>
- /// <param name="query">
- /// The query.
- /// </param>
- protected void DirectRun(string query)
+ public void SafelyClose()
{
- try
- {
- if (this.EncodeStarted != null)
- this.EncodeStarted(this, new EventArgs());
-
- IsEncoding = true;
+ if ((int)this.processHandle == 0)
+ return;
- ResetLogReader();
-
- // Setup the job
- string handbrakeCLIPath = Path.Combine(Environment.CurrentDirectory, "HandBrakeCLI.exe");
- HbProcess = new Process
- {
- StartInfo =
- {
- FileName = handbrakeCLIPath,
- Arguments = query,
- UseShellExecute = false,
- RedirectStandardOutput = true,
- RedirectStandardError = true,
- RedirectStandardInput = true,
- CreateNoWindow = false,
- WindowStyle = ProcessWindowStyle.Minimized
- }
- };
-
- // Setup event handlers for rediected data
- HbProcess.ErrorDataReceived += new DataReceivedEventHandler(HbProcErrorDataReceived);
- HbProcess.OutputDataReceived += new DataReceivedEventHandler(HbProcOutputDataReceived);
-
- // Start the process
- HbProcess.Start();
-
- // Setup the asynchronous reading of stdin and stderr
- HbProcess.BeginErrorReadLine();
- HbProcess.BeginOutputReadLine();
-
- // Set the Process Priority);
- switch (Settings.Default.processPriority)
- {
- case "Realtime":
- HbProcess.PriorityClass = ProcessPriorityClass.RealTime;
- break;
- case "High":
- HbProcess.PriorityClass = ProcessPriorityClass.High;
- break;
- case "Above Normal":
- HbProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
- break;
- case "Normal":
- HbProcess.PriorityClass = ProcessPriorityClass.Normal;
- break;
- case "Low":
- HbProcess.PriorityClass = ProcessPriorityClass.Idle;
- break;
- default:
- HbProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
- break;
- }
+ // Allow the CLI to exit cleanly
+ Win32.SetForegroundWindow((int)this.processHandle);
+ SendKeys.Send("^C");
+ SendKeys.Flush();
- // Set the class items
- this.processID = HbProcess.Id;
- this.processHandle = HbProcess.Handle;
- }
- catch (Exception exc)
+ if (HbProcess != null)
{
- Console.WriteLine(exc);
+ HbProcess.StandardInput.AutoFlush = true;
+ HbProcess.StandardInput.WriteLine("^C");
}
}
+ /* Helpers */
/// <summary>
/// Add the CLI Query to the Log File.
/// </summary>
/// <param name="encJob">
/// The Encode Job Object
/// </param>
- protected void AddCLIQueryToLog(Job encJob)
+ private static string CreateCliLogHeader(Job encJob)
{
try
{
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
- "\\HandBrake\\logs";
- string logPath = Path.Combine(logDir, "last_encode_log.txt");
+ //string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
+ // "\\HandBrake\\logs";
+ //string logPath = Path.Combine(logDir, "last_encode_log.txt");
+
+ //var reader = new StreamReader(File.Open(logPath, FileMode.Open, FileAccess.Read, FileShare.Read));
+ //string log = reader.ReadToEnd();
+ //reader.Close();
+
+ //var writer = new StreamWriter(File.Create(logPath));
- var reader = new StreamReader(File.Open(logPath, FileMode.Open, FileAccess.Read, FileShare.Read));
- string log = reader.ReadToEnd();
- reader.Close();
- var writer = new StreamWriter(File.Create(logPath));
+ //writer.WriteLine("### CLI Query: " + encJob.Query);
+ //writer.WriteLine("### User Query: " + encJob.CustomQuery);
+ //writer.WriteLine("#########################################");
+ //writer.WriteLine(log);
+ //writer.Flush();
+ //writer.Close();
+ StringBuilder logHeader = new StringBuilder();
+ logHeader.AppendLine("### CLI Query: " + encJob.Query);
+ logHeader.AppendLine("### User Query: " + encJob.CustomQuery);
+ logHeader.AppendLine("#########################################");
- writer.WriteLine("### CLI Query: " + encJob.Query);
- writer.WriteLine("### User Query: " + encJob.CustomQuery);
- writer.WriteLine("#########################################");
- writer.WriteLine(log);
- writer.Flush();
- writer.Close();
+ return logHeader.ToString();
}
catch (Exception)
{
- return;
+ return string.Empty;
}
}
@@ -453,21 +355,61 @@ namespace HandBrake.ApplicationServices.Services
}
/// <summary>
+ /// The HandBrakeCLI process has exited.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The EventArgs.
+ /// </param>
+ private void HbProcess_Exited(object sender, EventArgs e)
+ {
+ IsEncoding = false;
+
+ // ReadFile(null);
+
+ if (this.EncodeEnded != null)
+ this.EncodeEnded(this, new EventArgs());
+
+ if (windowsSeven.IsWindowsSeven)
+ {
+ windowsSeven.SetTaskBarProgressToNoProgress();
+ }
+
+ if (Properties.Settings.Default.preventSleep)
+ {
+ Win32.AllowSleep();
+ }
+
+ try
+ {
+ if (fileWriter != null)
+ fileWriter.Close();
+ }
+ catch(Exception exc)
+ {
+ Main.ShowExceptiowWindow("Unable to close the log file wrtier", exc.ToString());
+ }
+ }
+
+ /// <summary>
/// Read the log file
/// </summary>
/// <param name="n">
/// The object.
/// </param>
- private void ReadFile(object n)
+ private void ReadFile()
{
+ logBuffer = new StringBuilder();
lock (logBuffer)
{
// last_encode_log.txt is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it (Not even in read only mode),
// we'll need to make a copy of it.
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
- "\\HandBrake\\logs";
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
string logFile = Path.Combine(logDir, "last_encode_log.txt");
string logFile2 = Path.Combine(logDir, "tmp_appReadable_log.txt");
+ int logFilePosition = 0;
try
{
@@ -479,19 +421,8 @@ namespace HandBrake.ApplicationServices.Services
if (File.Exists(logFile))
File.Copy(logFile, logFile2, true);
else
- {
- ResetLogReader();
return;
- }
-
- // Put the Query and User Generated Query Flag on the log.
- if (logFilePosition == 0 && job.Query != null)
- {
- logBuffer.AppendLine("### CLI Query: " + job.Query);
- logBuffer.AppendLine("### User Query: " + job.CustomQuery);
- logBuffer.AppendLine("#########################################");
- }
-
+
// Start the Reader
// Only use text which continues on from the last read line
StreamReader sr = new StreamReader(logFile2);
@@ -509,42 +440,45 @@ namespace HandBrake.ApplicationServices.Services
sr.Close();
sr.Dispose();
}
- catch (Exception)
+ catch (Exception exc)
{
- ResetLogReader();
+ Main.ShowExceptiowWindow("Unable to read log file", exc.ToString());
}
}
}
/// <summary>
- /// Reset the Log Reader
+ /// Setup the logging.
/// </summary>
- private void ResetLogReader()
+ private void SetupLogging(Job encodeJob)
{
- logFilePosition = 0;
- logBuffer = new StringBuilder();
- }
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ string logFile = Path.Combine(logDir, "last_encode_log.txt");
+ string logFile2 = Path.Combine(logDir, "tmp_appReadable_log.txt");
- /// <summary>
- /// Recieve the Standard Error information and process it
- /// </summary>
- /// <param name="sender">
- /// The Sender Object
- /// </param>
- /// <param name="e">
- /// DataReceived EventArgs
- /// </param>
- private void HbProcErrorDataReceived(object sender, DataReceivedEventArgs e)
- {
- if (!String.IsNullOrEmpty(e.Data))
+ try
{
- lock (logBuffer)
- logBuffer.AppendLine(e.Data);
+ logBuffer = new StringBuilder();
+
+ // Clear the current Encode Logs
+ if (File.Exists(logFile)) File.Delete(logFile);
+ if (File.Exists(logFile2)) File.Delete(logFile2);
+
+ fileWriter = new StreamWriter(logFile) { AutoFlush = true };
+
+ fileWriter.WriteLine(CreateCliLogHeader(encodeJob));
+ logBuffer.AppendLine(CreateCliLogHeader(encodeJob));
+ }
+ catch (Exception exc)
+ {
+ if (fileWriter != null)
+ fileWriter.Close();
+ Main.ShowExceptiowWindow("Error", exc.ToString());
}
}
/// <summary>
- /// Standard Input Data Recieved from the CLI
+ /// Recieve the Standard Error information and process it
/// </summary>
/// <param name="sender">
/// The Sender Object
@@ -552,15 +486,27 @@ namespace HandBrake.ApplicationServices.Services
/// <param name="e">
/// DataReceived EventArgs
/// </param>
- private void HbProcOutputDataReceived(object sender, DataReceivedEventArgs e)
+ private void HbProcErrorDataReceived(object sender, DataReceivedEventArgs e)
{
if (!String.IsNullOrEmpty(e.Data))
{
lock (logBuffer)
logBuffer.AppendLine(e.Data);
+
+ try
+ {
+ if (fileWriter != null)
+ fileWriter.WriteLine(e.Data);
+ }
+ catch (Exception exc)
+ {
+ Main.ShowExceptiowWindow("Unable to write log data...", exc.ToString());
+ }
}
}
+ #region Encode Status from Standard Output
+
/// <summary>
/// Encode Started
/// </summary>
@@ -587,8 +533,6 @@ namespace HandBrake.ApplicationServices.Services
encode.OnEncodeProgress += EncodeOnEncodeProgress;
while (!encode.EndOfStream)
encode.ReadEncodeStatus();
-
- // Main.ShowExceptiowWindow("Encode Monitor Stopped", "Stopped");
}
catch (Exception exc)
{
@@ -629,5 +573,7 @@ namespace HandBrake.ApplicationServices.Services
windowsSeven.SetTaskBarProgress(percent);
}
}
+
+ #endregion
}
} \ No newline at end of file
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
index 5b6904f64..da32d2503 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs
@@ -380,7 +380,7 @@ namespace HandBrake.ApplicationServices.Services
Job encJob = this.GetNextJob();
this.WriteQueueStateToFile("hb_queue_recovery.xml"); // Update the queue recovery file
- Run(encJob, false);
+ Run(encJob, true);
if (HbProcess == null)
{
@@ -388,7 +388,6 @@ namespace HandBrake.ApplicationServices.Services
}
HbProcess.WaitForExit();
- AddCLIQueryToLog(encJob);
this.CopyLog(this.LastEncode.Destination);
HbProcess.Close();
diff --git a/win/C#/HandBrake.ApplicationServices/app.config b/win/C#/HandBrake.ApplicationServices/app.config
index 29ee4894d..4bb66af58 100644
--- a/win/C#/HandBrake.ApplicationServices/app.config
+++ b/win/C#/HandBrake.ApplicationServices/app.config
@@ -28,15 +28,9 @@
<setting name="processPriority" serializeAs="String">
<value />
</setting>
- <setting name="cli_minimized" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="showCliForInGuiEncodeStatus" serializeAs="String">
<value>False</value>
</setting>
- <setting name="enocdeStatusInGui" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="growlEncode" serializeAs="String">
<value>False</value>
</setting>
diff --git a/win/C#/Program.cs b/win/C#/Program.cs
index dde4a1a62..6480b50b1 100644
--- a/win/C#/Program.cs
+++ b/win/C#/Program.cs
@@ -88,8 +88,8 @@ namespace Handbrake
/// </summary>
private static void InitializeApplicationServices()
{
- Init.SetupSettings(Settings.Default.cli_minimized, Settings.Default.CompletionOption, Settings.Default.noDvdNav,
- Settings.Default.enocdeStatusInGui, Settings.Default.growlEncode, Settings.Default.growlQueue,
+ Init.SetupSettings(Settings.Default.CompletionOption, Settings.Default.noDvdNav,
+ Settings.Default.growlEncode, Settings.Default.growlQueue,
Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,
Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus, Settings.Default.preventSleep);
}
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs
index a6e909fde..1055f8794 100644
--- a/win/C#/Properties/Settings.Designer.cs
+++ b/win/C#/Properties/Settings.Designer.cs
@@ -169,18 +169,6 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool cli_minimized {
- get {
- return ((bool)(this["cli_minimized"]));
- }
- set {
- this["cli_minimized"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("{source}-{title}")]
public string autoNameFormat {
get {
@@ -314,18 +302,6 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
- public bool enocdeStatusInGui {
- get {
- return ((bool)(this["enocdeStatusInGui"]));
- }
- set {
- this["enocdeStatusInGui"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool trayIconAlerts {
get {
return ((bool)(this["trayIconAlerts"]));
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings
index 770a6fb77..c7e001d5e 100644
--- a/win/C#/Properties/Settings.settings
+++ b/win/C#/Properties/Settings.settings
@@ -38,9 +38,6 @@
<Setting Name="appcast_unstable" Type="System.String" Scope="User">
<Value Profile="(Default)">http://handbrake.fr/appcast_unstable.xml</Value>
</Setting>
- <Setting Name="cli_minimized" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
<Setting Name="autoNameFormat" Type="System.String" Scope="User">
<Value Profile="(Default)">{source}-{title}</Value>
</Setting>
@@ -74,9 +71,6 @@
<Setting Name="presetNotification" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
- <Setting Name="enocdeStatusInGui" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">True</Value>
- </Setting>
<Setting Name="trayIconAlerts" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
diff --git a/win/C#/app.config b/win/C#/app.config
index d8e0ef4b5..a51c09d8c 100644
--- a/win/C#/app.config
+++ b/win/C#/app.config
@@ -44,9 +44,6 @@
<setting name="appcast_unstable" serializeAs="String">
<value>http://handbrake.fr/appcast_unstable.xml</value>
</setting>
- <setting name="cli_minimized" serializeAs="String">
- <value>False</value>
- </setting>
<setting name="autoNameFormat" serializeAs="String">
<value>{source}-{title}</value>
</setting>
@@ -80,9 +77,6 @@
<setting name="presetNotification" serializeAs="String">
<value>False</value>
</setting>
- <setting name="enocdeStatusInGui" serializeAs="String">
- <value>True</value>
- </setting>
<setting name="trayIconAlerts" serializeAs="String">
<value>True</value>
</setting>
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 6937c5923..7f46139a2 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -1022,33 +1022,27 @@ namespace Handbrake
{
if (btn_start.Text == "Stop")
{
- DialogResult result;
- if (Properties.Settings.Default.enocdeStatusInGui &&
- !Properties.Settings.Default.showCliForInGuiEncodeStatus)
- {
- result = MessageBox.Show(
- "Are you sure you wish to cancel the encode?\n\nPlease note, when 'Enable in-GUI encode status' is enabled, stopping this encode will render the file unplayable. ",
- "Cancel Encode?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
- }
- else
- {
- result = MessageBox.Show("Are you sure you wish to cancel the encode?", "Cancel Encode?",
- MessageBoxButtons.YesNo, MessageBoxIcon.Question);
- }
+ DialogResult result = !Properties.Settings.Default.showCliForInGuiEncodeStatus
+ ? MessageBox.Show(
+ "Are you sure you wish to cancel the encode?\n\nPlease note: Stopping this encode will render the file unplayable. ",
+ "Cancel Encode?",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Question)
+ : MessageBox.Show(
+ "Are you sure you wish to cancel the encode?",
+ "Cancel Encode?",
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
// Pause The Queue
encodeQueue.Pause();
- if (Settings.Default.enocdeStatusInGui && !Settings.Default.showCliForInGuiEncodeStatus)
- {
- encodeQueue.Stop();
- }
- else
- {
+ if (Settings.Default.showCliForInGuiEncodeStatus)
encodeQueue.SafelyClose();
- }
+ else
+ encodeQueue.Stop();
}
}
else
@@ -2482,7 +2476,7 @@ namespace Handbrake
}
// Try to safely close out if we can, or kill the cli if using in-gui status
- if (Settings.Default.enocdeStatusInGui)
+ if (!Settings.Default.showCliForInGuiEncodeStatus)
encodeQueue.Stop();
else
encodeQueue.SafelyClose();
diff --git a/win/C#/frmOptions.Designer.cs b/win/C#/frmOptions.Designer.cs
index 71aa2e439..53d5ef9d1 100644
--- a/win/C#/frmOptions.Designer.cs
+++ b/win/C#/frmOptions.Designer.cs
@@ -69,10 +69,10 @@ namespace Handbrake
this.drop_preferredLang = new System.Windows.Forms.ComboBox();
this.radio_dub = new System.Windows.Forms.RadioButton();
this.tab_cli = new System.Windows.Forms.TabPage();
+ this.label11 = new System.Windows.Forms.Label();
this.check_preventSleep = new System.Windows.Forms.CheckBox();
this.check_clearOldLogs = new System.Windows.Forms.CheckBox();
this.label12 = new System.Windows.Forms.Label();
- this.check_cli_minimized = new System.Windows.Forms.CheckBox();
this.btn_viewLogs = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.Label4 = new System.Windows.Forms.Label();
@@ -100,7 +100,6 @@ namespace Handbrake
this.label30 = new System.Windows.Forms.Label();
this.check_disablePresetNotification = new System.Windows.Forms.CheckBox();
this.label28 = new System.Windows.Forms.Label();
- this.check_inGuiStatus = new System.Windows.Forms.CheckBox();
this.tab_debug = new System.Windows.Forms.TabPage();
this.check_disableResCalc = new System.Windows.Forms.CheckBox();
this.label8 = new System.Windows.Forms.Label();
@@ -137,7 +136,6 @@ namespace Handbrake
this.label27 = new System.Windows.Forms.Label();
this.openFile_vlc = new System.Windows.Forms.OpenFileDialog();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
- this.label11 = new System.Windows.Forms.Label();
this.tab_options.SuspendLayout();
this.tab_general.SuspendLayout();
this.tab_picture.SuspendLayout();
@@ -612,7 +610,6 @@ namespace Handbrake
this.tab_cli.Controls.Add(this.check_preventSleep);
this.tab_cli.Controls.Add(this.check_clearOldLogs);
this.tab_cli.Controls.Add(this.label12);
- this.tab_cli.Controls.Add(this.check_cli_minimized);
this.tab_cli.Controls.Add(this.btn_viewLogs);
this.tab_cli.Controls.Add(this.label9);
this.tab_cli.Controls.Add(this.Label4);
@@ -633,11 +630,23 @@ namespace Handbrake
this.tab_cli.Text = "CLI / System / Logging";
this.tab_cli.UseVisualStyleBackColor = true;
//
+ // label11
+ //
+ this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.label11.AutoSize = true;
+ this.label11.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label11.Location = new System.Drawing.Point(7, 46);
+ this.label11.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
+ this.label11.Name = "label11";
+ this.label11.Size = new System.Drawing.Size(53, 13);
+ this.label11.TabIndex = 92;
+ this.label11.Text = "System:";
+ //
// check_preventSleep
//
this.check_preventSleep.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.check_preventSleep.AutoSize = true;
- this.check_preventSleep.Location = new System.Drawing.Point(73, 71);
+ this.check_preventSleep.Location = new System.Drawing.Point(73, 45);
this.check_preventSleep.Name = "check_preventSleep";
this.check_preventSleep.Size = new System.Drawing.Size(272, 17);
this.check_preventSleep.TabIndex = 91;
@@ -650,7 +659,7 @@ namespace Handbrake
//
this.check_clearOldLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.check_clearOldLogs.AutoSize = true;
- this.check_clearOldLogs.Location = new System.Drawing.Point(73, 260);
+ this.check_clearOldLogs.Location = new System.Drawing.Point(73, 234);
this.check_clearOldLogs.Name = "check_clearOldLogs";
this.check_clearOldLogs.Size = new System.Drawing.Size(166, 17);
this.check_clearOldLogs.TabIndex = 90;
@@ -672,25 +681,12 @@ namespace Handbrake
this.label12.TabIndex = 75;
this.label12.Text = "CLI:";
//
- // check_cli_minimized
- //
- this.check_cli_minimized.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.check_cli_minimized.AutoSize = true;
- this.check_cli_minimized.Location = new System.Drawing.Point(73, 14);
- this.check_cli_minimized.Name = "check_cli_minimized";
- this.check_cli_minimized.Size = new System.Drawing.Size(137, 17);
- this.check_cli_minimized.TabIndex = 76;
- this.check_cli_minimized.Text = "Start window minimized";
- this.ToolTip.SetToolTip(this.check_cli_minimized, "Starts a CLI window minimized.");
- this.check_cli_minimized.UseVisualStyleBackColor = true;
- this.check_cli_minimized.CheckedChanged += new System.EventHandler(this.check_cli_minimized_CheckedChanged);
- //
// btn_viewLogs
//
this.btn_viewLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.btn_viewLogs.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_viewLogs.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_viewLogs.Location = new System.Drawing.Point(129, 222);
+ this.btn_viewLogs.Location = new System.Drawing.Point(129, 196);
this.btn_viewLogs.Name = "btn_viewLogs";
this.btn_viewLogs.Size = new System.Drawing.Size(139, 23);
this.btn_viewLogs.TabIndex = 89;
@@ -703,7 +699,7 @@ namespace Handbrake
this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label9.Location = new System.Drawing.Point(7, 118);
+ this.label9.Location = new System.Drawing.Point(7, 92);
this.label9.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(36, 13);
@@ -715,7 +711,7 @@ namespace Handbrake
this.Label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.Label4.AutoSize = true;
this.Label4.BackColor = System.Drawing.Color.Transparent;
- this.Label4.Location = new System.Drawing.Point(70, 34);
+ this.Label4.Location = new System.Drawing.Point(70, 15);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(70, 13);
this.Label4.TabIndex = 42;
@@ -726,7 +722,7 @@ namespace Handbrake
this.btn_clearLogs.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.btn_clearLogs.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_clearLogs.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_clearLogs.Location = new System.Drawing.Point(274, 222);
+ this.btn_clearLogs.Location = new System.Drawing.Point(274, 196);
this.btn_clearLogs.Name = "btn_clearLogs";
this.btn_clearLogs.Size = new System.Drawing.Size(135, 23);
this.btn_clearLogs.TabIndex = 88;
@@ -746,7 +742,7 @@ namespace Handbrake
"Normal",
"Below Normal",
"Low"});
- this.drp_Priority.Location = new System.Drawing.Point(177, 31);
+ this.drp_Priority.Location = new System.Drawing.Point(177, 12);
this.drp_Priority.Name = "drp_Priority";
this.drp_Priority.Size = new System.Drawing.Size(111, 21);
this.drp_Priority.TabIndex = 43;
@@ -758,7 +754,7 @@ namespace Handbrake
//
this.check_logsInSpecifiedLocation.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.check_logsInSpecifiedLocation.AutoSize = true;
- this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 165);
+ this.check_logsInSpecifiedLocation.Location = new System.Drawing.Point(73, 139);
this.check_logsInSpecifiedLocation.Name = "check_logsInSpecifiedLocation";
this.check_logsInSpecifiedLocation.Size = new System.Drawing.Size(306, 17);
this.check_logsInSpecifiedLocation.TabIndex = 87;
@@ -771,7 +767,7 @@ namespace Handbrake
//
this.check_saveLogWithVideo.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.check_saveLogWithVideo.AutoSize = true;
- this.check_saveLogWithVideo.Location = new System.Drawing.Point(73, 142);
+ this.check_saveLogWithVideo.Location = new System.Drawing.Point(73, 116);
this.check_saveLogWithVideo.Name = "check_saveLogWithVideo";
this.check_saveLogWithVideo.Size = new System.Drawing.Size(382, 17);
this.check_saveLogWithVideo.TabIndex = 83;
@@ -785,7 +781,7 @@ namespace Handbrake
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
- this.label3.Location = new System.Drawing.Point(70, 118);
+ this.label3.Location = new System.Drawing.Point(70, 92);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(101, 13);
this.label3.TabIndex = 85;
@@ -797,7 +793,7 @@ namespace Handbrake
this.btn_saveLog.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btn_saveLog.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btn_saveLog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_saveLog.Location = new System.Drawing.Point(437, 195);
+ this.btn_saveLog.Location = new System.Drawing.Point(437, 169);
this.btn_saveLog.Name = "btn_saveLog";
this.btn_saveLog.Size = new System.Drawing.Size(77, 22);
this.btn_saveLog.TabIndex = 82;
@@ -814,7 +810,7 @@ namespace Handbrake
"0",
"1",
"2"});
- this.cb_logVerboseLvl.Location = new System.Drawing.Point(177, 115);
+ this.cb_logVerboseLvl.Location = new System.Drawing.Point(177, 89);
this.cb_logVerboseLvl.Name = "cb_logVerboseLvl";
this.cb_logVerboseLvl.Size = new System.Drawing.Size(111, 21);
this.cb_logVerboseLvl.TabIndex = 86;
@@ -824,7 +820,7 @@ namespace Handbrake
// text_logPath
//
this.text_logPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
- this.text_logPath.Location = new System.Drawing.Point(129, 195);
+ this.text_logPath.Location = new System.Drawing.Point(129, 169);
this.text_logPath.Name = "text_logPath";
this.text_logPath.Size = new System.Drawing.Size(302, 21);
this.text_logPath.TabIndex = 80;
@@ -835,7 +831,7 @@ namespace Handbrake
//
this.label14.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(70, 198);
+ this.label14.Location = new System.Drawing.Point(70, 172);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(53, 13);
this.label14.TabIndex = 81;
@@ -857,7 +853,6 @@ namespace Handbrake
this.tab_advanced.Controls.Add(this.label30);
this.tab_advanced.Controls.Add(this.check_disablePresetNotification);
this.tab_advanced.Controls.Add(this.label28);
- this.tab_advanced.Controls.Add(this.check_inGuiStatus);
this.tab_advanced.Location = new System.Drawing.Point(4, 22);
this.tab_advanced.Name = "tab_advanced";
this.tab_advanced.Padding = new System.Windows.Forms.Padding(10);
@@ -871,7 +866,7 @@ namespace Handbrake
this.check_showCliForInGUIEncode.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.check_showCliForInGUIEncode.AutoSize = true;
this.check_showCliForInGUIEncode.BackColor = System.Drawing.Color.Transparent;
- this.check_showCliForInGUIEncode.Location = new System.Drawing.Point(100, 152);
+ this.check_showCliForInGUIEncode.Location = new System.Drawing.Point(81, 129);
this.check_showCliForInGUIEncode.Name = "check_showCliForInGUIEncode";
this.check_showCliForInGUIEncode.Size = new System.Drawing.Size(330, 17);
this.check_showCliForInGUIEncode.TabIndex = 96;
@@ -1054,20 +1049,6 @@ namespace Handbrake
this.label28.TabIndex = 85;
this.label28.Text = "x264:";
//
- // check_inGuiStatus
- //
- this.check_inGuiStatus.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.check_inGuiStatus.AutoSize = true;
- this.check_inGuiStatus.BackColor = System.Drawing.Color.Transparent;
- this.check_inGuiStatus.Location = new System.Drawing.Point(81, 129);
- this.check_inGuiStatus.Name = "check_inGuiStatus";
- this.check_inGuiStatus.Size = new System.Drawing.Size(162, 17);
- this.check_inGuiStatus.TabIndex = 92;
- this.check_inGuiStatus.Text = "Enable in-GUI encode status";
- this.ToolTip.SetToolTip(this.check_inGuiStatus, "Displays the CLI status in the GUI windows instead of the CLI window.");
- this.check_inGuiStatus.UseVisualStyleBackColor = false;
- this.check_inGuiStatus.CheckedChanged += new System.EventHandler(this.check_inGuiStatus_CheckedChanged);
- //
// tab_debug
//
this.tab_debug.Controls.Add(this.check_disableResCalc);
@@ -1471,18 +1452,6 @@ namespace Handbrake
this.tableLayoutPanel5.Size = new System.Drawing.Size(594, 429);
this.tableLayoutPanel5.TabIndex = 62;
//
- // label11
- //
- this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.label11.AutoSize = true;
- this.label11.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label11.Location = new System.Drawing.Point(7, 72);
- this.label11.Margin = new System.Windows.Forms.Padding(3, 5, 3, 0);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(53, 13);
- this.label11.TabIndex = 92;
- this.label11.Text = "System:";
- //
// frmOptions
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@@ -1546,7 +1515,6 @@ namespace Handbrake
internal System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox text_an_path;
internal System.Windows.Forms.CheckBox check_autoNaming;
- internal System.Windows.Forms.CheckBox check_cli_minimized;
private System.Windows.Forms.Label label12;
internal System.Windows.Forms.ToolTip ToolTip;
private System.Windows.Forms.TabPage tab_picture;
@@ -1601,7 +1569,6 @@ namespace Handbrake
private System.Windows.Forms.Label label32;
internal System.Windows.Forms.CheckBox check_logsInSpecifiedLocation;
internal System.Windows.Forms.CheckBox check_disablePresetNotification;
- internal System.Windows.Forms.CheckBox check_inGuiStatus;
internal System.Windows.Forms.CheckBox check_trayStatusAlerts;
private System.Windows.Forms.Button btn_viewLogs;
private System.Windows.Forms.Button btn_clearLogs;
diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs
index 3ca0298f7..492ee3577 100644
--- a/win/C#/frmOptions.cs
+++ b/win/C#/frmOptions.cs
@@ -112,10 +112,6 @@ namespace Handbrake
// CLI
// #############################
- // Enable Start CLI minimized
- if (Properties.Settings.Default.cli_minimized)
- check_cli_minimized.CheckState = CheckState.Checked;
-
// Priority level for encodes
drp_Priority.Text = Properties.Settings.Default.processPriority;
@@ -161,12 +157,8 @@ namespace Handbrake
if (Properties.Settings.Default.presetNotification)
check_disablePresetNotification.CheckState = CheckState.Checked;
- // Experimental In-GUI encode status indicator.
- if (Properties.Settings.Default.enocdeStatusInGui)
- check_inGuiStatus.CheckState = CheckState.Checked;
-
+ // Show CLI Window
check_showCliForInGUIEncode.Checked = Properties.Settings.Default.showCliForInGuiEncodeStatus;
- check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;
// Set the preview count
drop_previewScanCount.SelectedItem = Properties.Settings.Default.previewScanCount.ToString();
@@ -326,11 +318,6 @@ namespace Handbrake
#region CLI
- private void check_cli_minimized_CheckedChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.cli_minimized = check_cli_minimized.Checked;
- }
-
private void drp_Priority_SelectedIndexChanged(object sender, EventArgs e)
{
Properties.Settings.Default.processPriority = drp_Priority.Text;
@@ -427,24 +414,6 @@ namespace Handbrake
Properties.Settings.Default.presetNotification = check_disablePresetNotification.Checked;
}
- private void check_inGuiStatus_CheckedChanged(object sender, EventArgs e)
- {
- Properties.Settings.Default.enocdeStatusInGui = check_inGuiStatus.Checked;
-
- check_showCliForInGUIEncode.Enabled = check_inGuiStatus.Checked;
-
- if (this.IsHandleCreated)
- if (check_inGuiStatus.Checked)
- {
- MessageBox.Show(
- "This feature is experimental!\n\n You will not be able to �Stop� an encode mid-process.\n"
- + "Doing so will render the file unplayable.\n" +
- "If you enable 'Show CLI Window', you'll be ablt to hit ctrl-c in the encode window to cleanly exit the CLI. This will give you a playable file.\n\n" +
- "You are also limited to 1 instance of HandBrakeCLI on your system.",
- "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
-
private void check_showCliForInGUIEncode_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.showCliForInGuiEncodeStatus = check_showCliForInGUIEncode.Checked;
@@ -504,8 +473,8 @@ namespace Handbrake
/// </summary>
private static void UpdateApplicationServicesSettings()
{
- Init.SetupSettings(Settings.Default.cli_minimized, Settings.Default.CompletionOption, Settings.Default.noDvdNav,
- Settings.Default.enocdeStatusInGui, Settings.Default.growlEncode, Settings.Default.growlQueue,
+ Init.SetupSettings(Settings.Default.CompletionOption, Settings.Default.noDvdNav,
+ Settings.Default.growlEncode, Settings.Default.growlQueue,
Settings.Default.processPriority, Settings.Default.saveLogPath, Settings.Default.saveLogToSpecifiedPath,
Settings.Default.saveLogWithVideo, Settings.Default.showCliForInGuiEncodeStatus, Settings.Default.preventSleep);
}
diff --git a/win/C#/frmOptions.resx b/win/C#/frmOptions.resx
index a69782119..02f2ee7e0 100644
--- a/win/C#/frmOptions.resx
+++ b/win/C#/frmOptions.resx
@@ -120,17 +120,6 @@
<metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 18</value>
</metadata>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>132, 18</value>
- </metadata>
- <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">
- <value>Shows the CLI window when "Encode In-Gui encode status" is enabled.
-You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c
-meaing you'll have playable files if you choose to end the encode early.</value>
- </data>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>132, 18</value>
- </metadata>
<data name="check_m4v.ToolTip" xml:space="preserve">
<value>Use .m4v instead of .mp4 for MP4 files
@@ -138,6 +127,11 @@ Chapter Markers, AC3 Audio and SRT Subtitles will require the m4v extension if y
When this option is disabled, Chapter Markers, AC3 audio and SRT subtitiles will still automatically change the file extension to m4v.
</value>
</data>
+ <data name="check_showCliForInGUIEncode.ToolTip" xml:space="preserve">
+ <value>Shows the CLI window when "Encode In-Gui encode status" is enabled.
+You may wish to enable this as you'll be able to cleanly exit the CLI using ctrl-c
+meaing you'll have playable files if you choose to end the encode early.</value>
+ </data>
<data name="check_disableResCalc.ToolTip" xml:space="preserve">
<value>If the new Picture Settings panel is causing you problems, enable this option.
It disables some of the resolution calcuation code for None and Custom modes.
diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs
index a5bf3310e..d68841b49 100644
--- a/win/C#/frmPreview.cs
+++ b/win/C#/frmPreview.cs
@@ -24,6 +24,7 @@ namespace Handbrake
/// </summary>
public partial class frmPreview : Form
{
+ #region Private Variables
/// <summary>
/// The Main Window
/// </summary>
@@ -99,6 +100,8 @@ namespace Handbrake
/// </summary>
private delegate void OpenMovieHandler();
+ #endregion
+
/// <summary>
/// The encode has started
/// </summary>