X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmMain.cs;h=a377aca69d4b1006023eb5915052d7409083be78;hb=31e8e90017a38e8b35b8297eb338d6f4f79de6f4;hp=b46b5aeabf2fc3129b64b0ba9ecec58b3a7cc904;hpb=b3d432c70d660bf9d660fd928d00d53ba58e94a1;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index b46b5aea..a377aca6 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() @@ -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,24 +845,30 @@ namespace Handbrake private void btn_dvd_source_Click(object sender, EventArgs e) { if (DVD_Open.ShowDialog() == DialogResult.OK) - selectSource(DVD_Open.SelectedPath, 1); + { + 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) - selectSource(ISO_Open.FileName, 2); + { + 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], 3); + if (this.dvdDrivePath == null) return; + this.selectedSourceType = SourceType.DvdDrive; + selectSource(this.dvdDrivePath); } - private void selectSource(string file, int type) + private void selectSource(string file) { Check_ChapterMarkers.Enabled = true; lastAction = "scan"; @@ -921,6 +949,7 @@ 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.Clear(); Subtitles.setSubtitleTrackAuto(); } @@ -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,15 @@ 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