summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-05-11 12:49:29 +0000
committersr55 <[email protected]>2009-05-11 12:49:29 +0000
commit1eb2b7d6ddca6483b56c709b6690833170d80c4b (patch)
tree1f70a02d43be7b51faacd0b915acea3ea01e3e0b /win/C#/Functions
parent7dc573fdd16e755123456f03b48b4c13c78a7d84 (diff)
# Changed
- Initial work for multi-instance support. All CLI processes controled by their process ID, not Name. This prevents a scan from 1 instance killing a CLI encode from another. # Fixed - Disable angle dropdown when not using Libdvdnav - Fixed issue with angle dropdown where first item is not selected. This caused the generate query to break due to "--angle" with no value. - Fixed issue with the dropdown menu setup on the audio tab not working correctly due to updated encoder names and DTS support. - Fixed an exception conditon on cancel scan. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2412 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Encode.cs68
-rw-r--r--win/C#/Functions/QueryGenerator.cs5
2 files changed, 38 insertions, 35 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs
index 870c24a90..044fad359 100644
--- a/win/C#/Functions/Encode.cs
+++ b/win/C#/Functions/Encode.cs
@@ -41,6 +41,7 @@ namespace Handbrake.Functions
if (Properties.Settings.Default.cli_minimized == "Checked")
cliStart.WindowStyle = ProcessWindowStyle.Minimized;
hbProc = Process.Start(cliStart);
+ processID = hbProc.Id;
isEncoding = true;
currentQuery = query;
@@ -137,40 +138,36 @@ namespace Handbrake.Functions
/// <param name="destination"></param>
public void copyLog(string destination)
{
- // The user may wish to do something with the log.
- if (Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
+ try
{
- try
- {
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string tempLogFile = Path.Combine(logDir, "last_encode_log.txt");
-
- string encodeDestinationPath = Path.GetDirectoryName(destination);
- String[] destName = destination.Split('\\');
- string destinationFile = destName[destName.Length - 1];
- string encodeLogFile = DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + destinationFile + ".txt";
-
- // Make sure the log directory exists.
- if (!Directory.Exists(logDir))
- Directory.CreateDirectory(logDir);
-
- // Copy the Log to HandBrakes log folder in the users applciation data folder.
- File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
-
- // Save a copy of the log file in the same location as the enocde.
- if (Properties.Settings.Default.saveLogWithVideo == "Checked")
- File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
-
- // Save a copy of the log file to a user specified location
- if (Directory.Exists(Properties.Settings.Default.saveLogPath))
- if (Properties.Settings.Default.saveLogPath != String.Empty && Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
- File.Copy(tempLogFile, Path.Combine(Properties.Settings.Default.saveLogPath, encodeLogFile));
- }
- catch (Exception exc)
- {
- MessageBox.Show("Something went a bit wrong trying to copy your log file.\nError Information:\n\n" + exc, "Error",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ string tempLogFile = Path.Combine(logDir, "last_encode_log.txt");
+
+ string encodeDestinationPath = Path.GetDirectoryName(destination);
+ String[] destName = destination.Split('\\');
+ string destinationFile = destName[destName.Length - 1];
+ string encodeLogFile = DateTime.Now.ToString().Replace("/", "-").Replace(":", "-") + " " + destinationFile + ".txt";
+
+ // Make sure the log directory exists.
+ if (!Directory.Exists(logDir))
+ Directory.CreateDirectory(logDir);
+
+ // Copy the Log to HandBrakes log folder in the users applciation data folder.
+ File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
+
+ // Save a copy of the log file in the same location as the enocde.
+ if (Properties.Settings.Default.saveLogWithVideo == "Checked")
+ File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
+
+ // Save a copy of the log file to a user specified location
+ if (Directory.Exists(Properties.Settings.Default.saveLogPath))
+ if (Properties.Settings.Default.saveLogPath != String.Empty && Properties.Settings.Default.saveLogToSpecifiedPath == "Checked")
+ File.Copy(tempLogFile, Path.Combine(Properties.Settings.Default.saveLogPath, encodeLogFile));
+ }
+ catch (Exception exc)
+ {
+ MessageBox.Show("Something went a bit wrong trying to copy your log file.\nError Information:\n\n" + exc, "Error",
+ MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -184,5 +181,10 @@ namespace Handbrake.Functions
/// </summary>
public String currentQuery { get; set; }
+ /// <summary>
+ /// Get the process ID of the current encode.
+ /// </summary>
+ public int processID { get; set; }
+
}
}
diff --git a/win/C#/Functions/QueryGenerator.cs b/win/C#/Functions/QueryGenerator.cs
index f2a083afe..e043d85fc 100644
--- a/win/C#/Functions/QueryGenerator.cs
+++ b/win/C#/Functions/QueryGenerator.cs
@@ -34,8 +34,9 @@ namespace Handbrake.Functions
query += " -t " + titleInfo[0];
}
- if (mainWindow.drop_angle.SelectedIndex != 0)
- query += " --angle " + mainWindow.drop_angle.SelectedItem;
+ if (Properties.Settings.Default.dvdnav == "Checked")
+ if (mainWindow.drop_angle.Items.Count != 0)
+ query += " --angle " + mainWindow.drop_angle.SelectedItem;
if (mainWindow.drop_chapterFinish.Text == mainWindow.drop_chapterStart.Text && mainWindow.drop_chapterStart.Text != "Auto")
query += " -c " + mainWindow.drop_chapterStart.Text;