X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmMain.cs;h=93c889937fbd73cf451e18d264d3313b85b22b8d;hb=cfa1fb7010dc9324e15d257bad7a73af66e9eb10;hp=7116c8688fbb8bff8066f56b4aafec50c73cbbe9;hpb=7d260ea7005c7f9fd2e64f40b7ef20ce2d31b955;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 7116c868..93c88993 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -35,6 +35,9 @@ namespace Handbrake private Form splash; public string sourcePath; private string lastAction; + private SourceType selectedSourceType; + private string dvdDrivePath; + private string dvdDriveLabel; // Delegates ********************************************************** private delegate void UpdateWindowHandler(); @@ -181,6 +184,21 @@ namespace Handbrake } #endregion + #region Properties + public string SourceName + { + get + { + if (this.selectedSourceType == SourceType.DvdDrive) + { + return this.dvdDriveLabel; + } + + return Path.GetFileNameWithoutExtension(this.sourcePath); + } + } + #endregion + #region Events // Encoding Events for setting up the GUI private void events() @@ -674,10 +692,10 @@ namespace Handbrake if (Properties.Settings.Default.PromptOnUnmatchingQueries && !string.IsNullOrEmpty(specifiedQuery) && generatedQuery != specifiedQuery) { DialogResult result = MessageBox.Show("The query under the \"Query Editor\" tab " + - "does not match the current GUI settings. Because the manual query takes " + + "does not match the current GUI settings.\n\nBecause the manual query takes " + "priority over the GUI, your recently updated settings will not be taken " + "into account when encoding this job." + Environment.NewLine + Environment.NewLine + - "Do you want to replace the manual query with the GUI-generated query?", + "Do you want to replace the manual query with the updated GUI-generated query?", "Manual Query does not Match GUI", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button3); @@ -700,7 +718,7 @@ namespace Handbrake } else { - query = generatedQuery; + query = specifiedQuery; } DialogResult overwrite = DialogResult.Yes; @@ -711,7 +729,7 @@ namespace Handbrake if (overwrite == DialogResult.Yes) { if (encodeQueue.Count == 0) - encodeQueue.AddJob(query, sourcePath, text_destination.Text); + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); queueWindow.setQueue(); if (encodeQueue.Count > 1) @@ -746,11 +764,13 @@ namespace Handbrake 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?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) - encodeQueue.AddJob(query, sourcePath, text_destination.Text); + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); } else - encodeQueue.AddJob(query, sourcePath, text_destination.Text); + encodeQueue.AddJob(query, sourcePath, text_destination.Text, (rtf_query.Text != "")); + + lbl_encode.Text = encodeQueue.Count + " encode(s) pending in the queue"; queueWindow.Show(); } @@ -786,6 +806,8 @@ namespace Handbrake if (ActivityWindow == null) ActivityWindow = new frmActivityWindow(file, encodeQueue, this); + ActivityWindow.SetLogView(!encodeQueue.isEncoding); + ActivityWindow.Show(); } #endregion @@ -823,22 +845,28 @@ namespace Handbrake private void btn_dvd_source_Click(object sender, EventArgs e) { if (DVD_Open.ShowDialog() == DialogResult.OK) + { + this.selectedSourceType = SourceType.Folder; selectSource(DVD_Open.SelectedPath); + } else UpdateSourceLabel(); } private void btn_file_source_Click(object sender, EventArgs e) { if (ISO_Open.ShowDialog() == DialogResult.OK) + { + this.selectedSourceType = SourceType.VideoFile; selectSource(ISO_Open.FileName); + } else UpdateSourceLabel(); } private void mnu_dvd_drive_Click(object sender, EventArgs e) { - if (!mnu_dvd_drive.Text.Contains("VIDEO_TS")) return; - string[] path = mnu_dvd_drive.Text.Split(' '); - selectSource(path[0]); + if (this.dvdDrivePath == null) return; + this.selectedSourceType = SourceType.DvdDrive; + selectSource(this.dvdDrivePath); } private void selectSource(string file) { @@ -887,7 +915,7 @@ namespace Handbrake // Populate the Angles dropdown drop_angle.Items.Clear(); - if (Properties.Settings.Default.dvdnav) + if (!Properties.Settings.Default.noDvdNav) { drop_angle.Visible = true; lbl_angle.Visible = true; @@ -921,7 +949,8 @@ namespace Handbrake Subtitles.drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)"); Subtitles.drp_subtitleTracks.Items.AddRange(selectedTitle.Subtitles.ToArray()); Subtitles.drp_subtitleTracks.SelectedIndex = 0; - Subtitles.setSubtitleTrackAuto(); + Subtitles.Clear(); + Subtitles.SetSubtitleTrackAuto(); } // Run the autoName & chapterNaming functions @@ -1096,7 +1125,7 @@ namespace Handbrake } AudioSettings.SetContainer(drop_format.Text); - Subtitles.setContainer(drop_format.SelectedIndex); + Subtitles.SetContainer(drop_format.SelectedIndex); if (drop_format.Text.Contains("MP4")) { @@ -1425,8 +1454,8 @@ namespace Handbrake File.Delete(dvdInfoPath); String dvdnav = string.Empty; - if (Properties.Settings.Default.dvdnav) - dvdnav = " --dvdnav"; + if (Properties.Settings.Default.noDvdNav) + dvdnav = " --no-dvdnav"; string strCmdLine = String.Format(@"cmd /c """"{0}"" -i ""{1}"" -t0 {2} -v >""{3}"" 2>&1""", handbrakeCLIPath, sourcePath, dvdnav, dvdInfoPath); ProcessStartInfo hbParseDvd = new ProcessStartInfo("CMD.exe", strCmdLine) { WindowStyle = ProcessWindowStyle.Hidden }; @@ -1571,7 +1600,7 @@ namespace Handbrake } private void UpdateSourceLabel() { - labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : Path.GetFileName(sourcePath); + labelSource.Text = string.IsNullOrEmpty(sourcePath) ? "Select \"Source\" to continue." : this.SourceName; } #endregion @@ -1622,7 +1651,7 @@ namespace Handbrake } lbl_encode.Visible = true; - lbl_encode.Text = "Encoding in Progress"; + lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending"; btn_start.Text = "Stop"; btn_start.ToolTipText = "Stop the encoding process."; btn_start.Image = Properties.Resources.stop; @@ -1653,7 +1682,9 @@ namespace Handbrake { if (File.Exists(curDrive.RootDirectory + "VIDEO_TS\\VIDEO_TS.IFO")) { - mnu_dvd_drive.Text = curDrive.RootDirectory + "VIDEO_TS (" + curDrive.VolumeLabel + ")"; + this.dvdDrivePath = curDrive.RootDirectory + "VIDEO_TS"; + this.dvdDriveLabel = curDrive.VolumeLabel; + mnu_dvd_drive.Text = this.dvdDrivePath + " (" + this.dvdDriveLabel + ")"; foundDrive = true; break; } @@ -1733,6 +1764,16 @@ namespace Handbrake } #endregion + #region enum + private enum SourceType + { + None = 0, + Folder, + DvdDrive, + VideoFile + } + #endregion + // This is the END of the road **************************************** } } \ No newline at end of file