From: sr55 Date: Sun, 30 May 2010 13:08:07 +0000 (+0000) Subject: WinGui: X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9d2f980a170446dbe78bf88779f549658821abfa;p=handbrake-jp%2Fhandbrake-jp-git.git WinGui: - Some additional cleanup to the Subtitles files. git-svn-id: svn://localhost/HandBrake/trunk@3334 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs index d3f87959..e923598e 100644 --- a/win/C#/Controls/Subtitles.cs +++ b/win/C#/Controls/Subtitles.cs @@ -34,11 +34,6 @@ namespace Handbrake.Controls private readonly List subList = new List(); /// - /// The File Container - /// - private int fileContainer; - - /// /// Initializes a new instance of the class. /// public Subtitles() @@ -259,11 +254,29 @@ namespace Handbrake.Controls srtFiles.Add(Path.GetFileName(openFileDialog.FileName), openFileDialog.FileName); } + /// + /// Remove a subtitle track + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void BtnRemoveSubTrackClick(object sender, EventArgs e) { RemoveTrack(); } + /// + /// The Subtitle List selected index has changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void LbSubListSelectedIndexChanged(object sender, EventArgs e) { // Set the dropdown controls based on the selected item in the List. @@ -308,6 +321,15 @@ namespace Handbrake.Controls /* Bitmap / CC / SRT Controls */ + /// + /// Handle the Subtitle track dropdown changed event + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void DrpSubtitleTracksSelectedIndexChanged(object sender, EventArgs e) { if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt")) @@ -349,6 +371,15 @@ namespace Handbrake.Controls subList[lv_subList.SelectedIndices[0]].Track = drp_subtitleTracks.SelectedItem.ToString(); } + /// + /// Foreced Subtitles checkbox changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void CheckForcedCheckedChanged(object sender, EventArgs e) { if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return; @@ -360,6 +391,15 @@ namespace Handbrake.Controls // Update SubList List } + /// + /// Burned in subtitles checkbox changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void CheckBurnedCheckedChanged(object sender, EventArgs e) { if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return; @@ -374,6 +414,15 @@ namespace Handbrake.Controls // Update SubList List } + /// + /// Default Subitle track check changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void CheckDefaultCheckedChanged(object sender, EventArgs e) { if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return; @@ -391,6 +440,15 @@ namespace Handbrake.Controls // Update SubList List } + /// + /// Srt Offset Numeric Control Changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void SrtOffsetValueChanged(object sender, EventArgs e) { // Update an item in the list if required. @@ -404,6 +462,15 @@ namespace Handbrake.Controls // Update SubList List } + /// + /// The SRT Charcode changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void SrtCharcodeSelectedIndexChanged(object sender, EventArgs e) { if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return; @@ -415,6 +482,15 @@ namespace Handbrake.Controls // Update SubList List } + /// + /// The Srt Language code changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void SrtLangSelectedIndexChanged(object sender, EventArgs e) { if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return; @@ -428,6 +504,15 @@ namespace Handbrake.Controls /* Right Click Menu */ + /// + /// Move an item in the subtitle list up + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void MnuMoveupClick(object sender, EventArgs e) { if (lv_subList.SelectedIndices.Count != 0) @@ -446,6 +531,15 @@ namespace Handbrake.Controls } } + /// + /// Move an item in the subtitle list down + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void MnuMovedownClick(object sender, EventArgs e) { if (lv_subList.SelectedIndices.Count != 0) @@ -464,6 +558,15 @@ namespace Handbrake.Controls } } + /// + /// Remove a selected subtitle track. + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void MnuRemoveClick(object sender, EventArgs e) { RemoveTrack(); @@ -571,15 +674,7 @@ namespace Handbrake.Controls /// True if Yes public bool RequiresM4V() { - foreach (ListViewItem item in lv_subList.Items) - { - if (item.SubItems.Count != 5) - return true; - - if (item.SubItems[1].Text.Contains("(Text)")) - return true; - } - return false; + return this.lv_subList.Items.Cast().Any(item => item.SubItems.Count != 5 || item.SubItems[1].Text.Contains("(Text)")); } /// @@ -615,15 +710,6 @@ namespace Handbrake.Controls } /// - /// Set the file container which is currently in use. - /// - /// The File Container - public void SetContainer(int value) - { - fileContainer = value; - } - - /// /// Get the list of subtitles. /// /// A List of SubtitleInfo Object diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 79be56d0..1a1cfae4 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1660,7 +1660,6 @@ namespace Handbrake } AudioSettings.SetContainer(drop_format.Text); - Subtitles.SetContainer(drop_format.SelectedIndex); if (drop_format.Text.Contains("MP4")) {