private Form splash;\r
public string sourcePath;\r
private string lastAction;\r
+ private SourceType selectedSourceType;\r
+ private string dvdDrivePath;\r
+ private string dvdDriveLabel;\r
\r
// Delegates **********************************************************\r
private delegate void UpdateWindowHandler();\r
}\r
#endregion\r
\r
+ #region Properties\r
+ public string SourceName\r
+ {\r
+ get\r
+ {\r
+ if (this.selectedSourceType == SourceType.DvdDrive)\r
+ {\r
+ return this.dvdDriveLabel;\r
+ }\r
+\r
+ return Path.GetFileNameWithoutExtension(this.sourcePath);\r
+ }\r
+ }\r
+ #endregion\r
+\r
#region Events\r
// Encoding Events for setting up the GUI\r
private void events()\r
if (Properties.Settings.Default.PromptOnUnmatchingQueries && !string.IsNullOrEmpty(specifiedQuery) && generatedQuery != specifiedQuery)\r
{\r
DialogResult result = MessageBox.Show("The query under the \"Query Editor\" tab " +\r
- "does not match the current GUI settings. Because the manual query takes " +\r
+ "does not match the current GUI settings.\n\nBecause the manual query takes " +\r
"priority over the GUI, your recently updated settings will not be taken " +\r
"into account when encoding this job." + Environment.NewLine + Environment.NewLine +\r
- "Do you want to replace the manual query with the GUI-generated query?",\r
+ "Do you want to replace the manual query with the updated GUI-generated query?",\r
"Manual Query does not Match GUI",\r
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk,\r
MessageBoxDefaultButton.Button3);\r
}\r
else\r
{\r
- query = generatedQuery;\r
+ query = specifiedQuery;\r
}\r
\r
DialogResult overwrite = DialogResult.Yes;\r
if (overwrite == DialogResult.Yes)\r
{\r
if (encodeQueue.Count == 0)\r
- encodeQueue.AddJob(query, sourcePath, text_destination.Text);\r
+ encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != ""));\r
\r
queueWindow.setQueue();\r
if (encodeQueue.Count > 1)\r
DialogResult result = MessageBox.Show("There is already a queue item for this destination path. \n\n If you continue, the encode will be overwritten. Do you wish to continue?",\r
"Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);\r
if (result == DialogResult.Yes)\r
- encodeQueue.AddJob(query, sourcePath, text_destination.Text);\r
+ encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != ""));\r
\r
}\r
else\r
- encodeQueue.AddJob(query, sourcePath, text_destination.Text);\r
+ encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != ""));\r
+\r
+ lbl_encode.Text = encodeQueue.Count + " encode(s) pending in the queue";\r
\r
queueWindow.Show();\r
}\r
if (ActivityWindow == null)\r
ActivityWindow = new frmActivityWindow(file, encodeQueue, this);\r
\r
+ ActivityWindow.SetLogView(!encodeQueue.isEncoding);\r
+\r
ActivityWindow.Show();\r
}\r
#endregion\r
private void btn_dvd_source_Click(object sender, EventArgs e)\r
{\r
if (DVD_Open.ShowDialog() == DialogResult.OK)\r
+ {\r
+ this.selectedSourceType = SourceType.Folder;\r
selectSource(DVD_Open.SelectedPath);\r
+ }\r
else\r
UpdateSourceLabel();\r
}\r
private void btn_file_source_Click(object sender, EventArgs e)\r
{\r
if (ISO_Open.ShowDialog() == DialogResult.OK)\r
+ {\r
+ this.selectedSourceType = SourceType.VideoFile;\r
selectSource(ISO_Open.FileName);\r
+ }\r
else\r
UpdateSourceLabel();\r
}\r
private void mnu_dvd_drive_Click(object sender, EventArgs e)\r
{\r
- if (!mnu_dvd_drive.Text.Contains("VIDEO_TS")) return;\r
- string[] path = mnu_dvd_drive.Text.Split(' ');\r
- selectSource(path[0]);\r
+ if (this.dvdDrivePath == null) return;\r
+ this.selectedSourceType = SourceType.DvdDrive;\r
+ selectSource(this.dvdDrivePath);\r
}\r
private void selectSource(string file)\r
{\r
\r
// Populate the Angles dropdown\r
drop_angle.Items.Clear();\r
- if (Properties.Settings.Default.dvdnav)\r
+ if (!Properties.Settings.Default.noDvdNav)\r
{\r
drop_angle.Visible = true;\r
lbl_angle.Visible = true;\r
Subtitles.drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");\r
Subtitles.drp_subtitleTracks.Items.AddRange(selectedTitle.Subtitles.ToArray());\r
Subtitles.drp_subtitleTracks.SelectedIndex = 0;\r
- Subtitles.setSubtitleTrackAuto();\r
+ Subtitles.Clear();\r
+ Subtitles.SetSubtitleTrackAuto();\r
}\r
\r
// Run the autoName & chapterNaming functions\r
}\r
\r
AudioSettings.SetContainer(drop_format.Text);\r
- Subtitles.setContainer(drop_format.SelectedIndex);\r
+ Subtitles.SetContainer(drop_format.SelectedIndex);\r
\r
if (drop_format.Text.Contains("MP4"))\r
{\r
File.Delete(dvdInfoPath);\r
\r
String dvdnav = string.Empty;\r
- if (Properties.Settings.Default.dvdnav)\r
- dvdnav = " --dvdnav";\r
+ if (Properties.Settings.Default.noDvdNav)\r
+ dvdnav = " --no-dvdnav";\r
string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 {2} -v >""{3}"" 2>&1""", handbrakeCLIPath, sourcePath, dvdnav, dvdInfoPath);\r
\r
ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden };\r
}\r
private void UpdateSourceLabel()\r
{\r
- labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : Path.GetFileName(sourcePath);\r
+ labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : this.SourceName;\r
}\r
#endregion\r
\r
}\r
\r
lbl_encode.Visible = true;\r
- lbl_encode.Text = "Encoding in Progress";\r
+ lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending";\r
btn_start.Text = "Stop";\r
btn_start.ToolTipText = "Stop the encoding process.";\r
btn_start.Image = Properties.Resources.stop;\r
{\r
if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO"))\r
{\r
- mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")";\r
+ this.dvdDrivePath = curDrive.RootDirectory + "VIDEO_TS";\r
+ this.dvdDriveLabel = curDrive.VolumeLabel;\r
+ mnu_dvd_drive.Text = this.dvdDrivePath + " (" + this.dvdDriveLabel + ")";\r
foundDrive = true;\r
break;\r
}\r
}\r
#endregion\r
\r
+ #region enum\r
+ private enum SourceType\r
+ {\r
+ None = 0,\r
+ Folder,\r
+ DvdDrive,\r
+ VideoFile\r
+ }\r
+ #endregion\r
+\r
// This is the END of the road ****************************************\r
}\r
}
\ No newline at end of file