// Objects which may be used by one or more other objects\r
Functions.Main hb_common_func = new Functions.Main();\r
Functions.Encode cliObj = new Functions.Encode();\r
- Functions.Queue encodeQueue = new Functions.Queue();\r
+ Queue.Queue encodeQueue = new Queue.Queue();\r
Presets.PresetsHandler presetHandler = new Presets.PresetsHandler();\r
Parsing.Title selectedTitle;\r
\r
DialogResult result = MessageBox.Show("HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?", "Queue Recovery Possible", MessageBoxButtons.YesNo, MessageBoxIcon.Question);\r
\r
if (result == DialogResult.Yes)\r
- encodeQueue.recoverQueue("hb_queue_recovery.dat"); // Start Recovery\r
+ encodeQueue.recoverQueue("hb_queue_recovery.xml"); // Start Recovery\r
else\r
{\r
// Remove the Queue recovery file if the user doesn't want to recovery the last queue.\r
- string queuePath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.dat");\r
+ string queuePath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml");\r
if (File.Exists(queuePath))\r
File.Delete(queuePath);\r
}\r
if (rtf_query.Text != "")\r
query = rtf_query.Text;\r
\r
- encodeQueue.add(query);\r
- encodeQueue.write2disk("hb_queue_recovery.dat"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
+ encodeQueue.add(query, text_source.Text, text_destination.Text);\r
+ encodeQueue.write2disk("hb_queue_recovery.xml"); // Writes the queue to the recovery file, just incase the GUI crashes.\r
\r
queueWindow.setQueue(encodeQueue);\r
queueWindow.Show();\r
DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", "").Replace(".m4v", "").Replace(".mkv", "").Replace(".ogm", "").Replace(".avi", "");\r
\r
// Show the dialog and set the main form file path\r
- DVD_Save.ShowDialog();\r
- if (DVD_Save.FileName.StartsWith("\\"))\r
- MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
- else\r
- {\r
- setAudioByContainer(DVD_Save.FileName);\r
\r
- text_destination.Text = DVD_Save.FileName;\r
+ if (text_destination.Text.EndsWith(".mp4"))\r
+ DVD_Save.FilterIndex = 1;\r
+ else if (text_destination.Text.EndsWith(".m4v"))\r
+ DVD_Save.FilterIndex = 2;\r
+ else if (text_destination.Text.EndsWith(".avi"))\r
+ DVD_Save.FilterIndex = 3;\r
+ else if (text_destination.Text.EndsWith(".ogm"))\r
+ DVD_Save.FilterIndex = 4;\r
+ else if (text_destination.Text.EndsWith(".mkv"))\r
+ DVD_Save.FilterIndex = 5;\r
+\r
+ if (DVD_Save.ShowDialog() == DialogResult.OK)\r
+ {\r
+ if (DVD_Save.FileName.StartsWith("\\"))\r
+ MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ else\r
+ {\r
+ setAudioByContainer(DVD_Save.FileName);\r
+ text_destination.Text = DVD_Save.FileName;\r
\r
- // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)\r
- if (Check_ChapterMarkers.Checked)\r
- text_destination.Text = text_destination.Text.Replace(".mp4", ".m4v");\r
+ // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)\r
+ if (Check_ChapterMarkers.Checked)\r
+ text_destination.Text = text_destination.Text.Replace(".mp4", ".m4v");\r
+ }\r
}\r
}\r
private void text_destination_TextChanged(object sender, EventArgs e)\r
private void drop_format_SelectedIndexChanged(object sender, EventArgs e)\r
{\r
if (drop_format.SelectedIndex == 0)\r
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".mp4");\r
+ setExtension(".mp4");\r
else if (drop_format.SelectedIndex == 1)\r
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".m4v");\r
+ setExtension(".m4v");\r
else if (drop_format.SelectedIndex == 2)\r
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".mkv");\r
+ setExtension(".mkv");\r
else if (drop_format.SelectedIndex == 3)\r
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".avi");\r
+ setExtension(".avi");\r
else if (drop_format.SelectedIndex == 4)\r
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".ogm");\r
+ setExtension(".ogm");\r
+\r
}\r
\r
//Video Tab\r
{\r
if (treeView_presets.SelectedNode != null)\r
presetHandler.remove(treeView_presets.SelectedNode.Text);\r
- \r
+\r
// Remember each nodes expanded status so we can reload it\r
List<Boolean> nodeStatus = saveTreeViewState();\r
\r
foreach (TreeNode node in treenode.Nodes)\r
{\r
if (node.Text.ToString().Equals("Normal"))\r
- treeView_presets.SelectedNode = treeView_presets.Nodes[treenode.Index].Nodes[0];\r
+ treeView_presets.SelectedNode = treeView_presets.Nodes[treenode.Index].Nodes[0];\r
}\r
}\r
}\r
+ /// <summary>\r
+ /// Take in a File destination and change it's file extension to a new Extension\r
+ /// </summary>\r
+ /// <param name="destination"></param>\r
+ /// <param name="newExtension"></param>\r
+ /// <returns>String of the new file path and extension</returns>\r
+ public void setExtension(string newExtension)\r
+ {\r
+ text_destination.Text = text_destination.Text.Replace(".mp4", newExtension);\r
+ text_destination.Text = text_destination.Text.Replace(".m4v", newExtension);\r
+ text_destination.Text = text_destination.Text.Replace(".mkv", newExtension);\r
+ text_destination.Text = text_destination.Text.Replace(".avi", newExtension);\r
+ text_destination.Text = text_destination.Text.Replace(".ogm", newExtension);\r
+ }\r
#endregion\r
\r
#region Drive Detection\r
\r
// After the encode is done, we may want to shutdown, suspend etc.\r
cliObj.addCLIQueryToLog((string)state);\r
- cliObj.copyLog((string)state); // Make a copy of the log in the users desired location if necessary\r
+ cliObj.copyLog((string)state, text_destination.Text); // Make a copy of the log in the users desired location if necessary\r
cliObj.afterEncodeAction();\r
}\r
}\r
}\r
\r
// Third Case - Any presets the sub presets detected in the above if statment.\r
- if (preset.Level == 1 && workingLevel == 2 && previousCategory == preset.Category)\r
+ if (preset.Level == 1 && workingLevel == 2)\r
{\r
workingLevel = preset.Level;\r
currentCategory = preset.Category;\r