diff options
Diffstat (limited to 'win/C#/Controls')
-rw-r--r-- | win/C#/Controls/Filters.cs | 152 | ||||
-rw-r--r-- | win/C#/Controls/PictureSettings.cs | 6 | ||||
-rw-r--r-- | win/C#/Controls/Subtitles.cs | 53 |
3 files changed, 119 insertions, 92 deletions
diff --git a/win/C#/Controls/Filters.cs b/win/C#/Controls/Filters.cs index 757536ced..6f8d3afd5 100644 --- a/win/C#/Controls/Filters.cs +++ b/win/C#/Controls/Filters.cs @@ -1,12 +1,24 @@ -using System;
+/* Filters.cs $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+using System;
using System.Windows.Forms;
namespace Handbrake.Controls
{
public partial class Filters : UserControl
{
+ /// <summary>
+ /// The Filter settings have changed
+ /// </summary>
public event EventHandler FilterSettingsChanged;
+ /// <summary>
+ /// Creates a new instance of Filters
+ /// </summary>
public Filters()
{
InitializeComponent();
@@ -16,53 +28,10 @@ namespace Handbrake.Controls drop_detelecine.SelectedIndex = 0;
}
- // Controls
- private void drop_detelecine_SelectedIndexChanged(object sender, EventArgs e)
- {
- text_customDT.Visible = drop_detelecine.Text == "Custom";
- // A Filter has changed so raise a FilterSettingsChanged event.
- if (this.FilterSettingsChanged != null)
- this.FilterSettingsChanged(this, new EventArgs());
- }
- private void drop_decomb_SelectedIndexChanged(object sender, EventArgs e)
- {
- text_customDC.Visible = drop_decomb.Text == "Custom";
- if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
- drop_deinterlace.SelectedIndex = 0;
-
- // A Filter has changed so raise a FilterSettingsChanged event.
- if (this.FilterSettingsChanged != null)
- this.FilterSettingsChanged(this, new EventArgs());
- }
- private void drop_deinterlace_SelectedIndexChanged(object sender, EventArgs e)
- {
- text_customDI.Visible = drop_deinterlace.Text == "Custom";
- if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
- drop_decomb.SelectedIndex = 0;
-
- // A Filter has changed so raise a FilterSettingsChanged event.
- if (this.FilterSettingsChanged != null)
- this.FilterSettingsChanged(this, new EventArgs());
- }
- private void drop_denoise_SelectedIndexChanged(object sender, EventArgs e)
- {
- text_customDN.Visible = drop_denoise.Text == "Custom";
-
- // A Filter has changed so raise a FilterSettingsChanged event.
- if (this.FilterSettingsChanged != null)
- this.FilterSettingsChanged(this, new EventArgs());
- }
- private void slider_deblock_Scroll(object sender, EventArgs e)
- {
- lbl_deblockVal.Text = slider_deblock.Value == 4 ? "Off" : slider_deblock.Value.ToString();
-
- // A Filter has changed so raise a FilterSettingsChanged event.
- if (this.FilterSettingsChanged != null)
- this.FilterSettingsChanged(this, new EventArgs());
- }
-
- // Returns the CLI query for the query generator.
- public string getCLIQuery
+ /// <summary>
+ /// Returns the CLI query for the query generator.
+ /// </summary>
+ public string GetCLIQuery
{
get
{
@@ -155,8 +124,11 @@ namespace Handbrake.Controls }
}
- // Setup for each component for the preset loader.
- public void setDeTelecine(string value)
+ /// <summary>
+ /// Set the Detelecine control
+ /// </summary>
+ /// <param name="value">The value part of the CLI string</param>
+ public void SetDeTelecine(string value)
{
text_customDT.Text = "";
text_customDT.Visible = false;
@@ -175,7 +147,12 @@ namespace Handbrake.Controls break;
}
}
- public void setDeNoise(string value)
+
+ /// <summary>
+ /// Set the Denoise control
+ /// </summary>
+ /// <param name="value">The value part of the CLI string</param>
+ public void SetDeNoise(string value)
{
text_customDN.Text = "";
text_customDN.Visible = false;
@@ -200,7 +177,12 @@ namespace Handbrake.Controls break;
}
}
- public void setDeInterlace(string value)
+
+ /// <summary>
+ /// Set the Deinterlace Control
+ /// </summary>
+ /// <param name="value">The value part of the CLI string</param>
+ public void SetDeInterlace(string value)
{
text_customDI.Text = "";
text_customDI.Visible = false;
@@ -227,7 +209,12 @@ namespace Handbrake.Controls break;
}
}
- public void setDecomb(string value)
+
+ /// <summary>
+ /// Set the Decomb Control
+ /// </summary>
+ /// <param name="value">The value part of the CLI string</param>
+ public void SetDecomb(string value)
{
text_customDC.Text = "";
text_customDC.Visible = false;
@@ -246,7 +233,12 @@ namespace Handbrake.Controls break;
}
}
- public void setDeBlock(int value)
+
+ /// <summary>
+ /// Set the Deblock Control
+ /// </summary>
+ /// <param name="value">The deblock value</param>
+ public void SetDeBlock(int value)
{
if (value != 0)
{
@@ -259,9 +251,59 @@ namespace Handbrake.Controls lbl_deblockVal.Text = "Off";
}
}
- public void setGrayScale(bool value)
+
+ /// <summary>
+ /// Set the grayscale control
+ /// </summary>
+ /// <param name="value">Boolean value</param>
+ public void SetGrayScale(bool value)
{
check_grayscale.CheckState = value ? CheckState.Checked : CheckState.Unchecked;
}
+
+ // Controls
+ private void drop_detelecine_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ text_customDT.Visible = drop_detelecine.Text == "Custom";
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
+ }
+ private void drop_decomb_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ text_customDC.Visible = drop_decomb.Text == "Custom";
+ if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
+ drop_deinterlace.SelectedIndex = 0;
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
+ }
+ private void drop_deinterlace_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ text_customDI.Visible = drop_deinterlace.Text == "Custom";
+ if (drop_decomb.SelectedIndex != 0 && drop_deinterlace.SelectedIndex != 0)
+ drop_decomb.SelectedIndex = 0;
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
+ }
+ private void drop_denoise_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ text_customDN.Visible = drop_denoise.Text == "Custom";
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
+ }
+ private void slider_deblock_Scroll(object sender, EventArgs e)
+ {
+ lbl_deblockVal.Text = slider_deblock.Value == 4 ? "Off" : slider_deblock.Value.ToString();
+
+ // A Filter has changed so raise a FilterSettingsChanged event.
+ if (this.FilterSettingsChanged != null)
+ this.FilterSettingsChanged(this, new EventArgs());
+ }
}
}
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs index cf8f022f1..d5d088b47 100644 --- a/win/C#/Controls/PictureSettings.cs +++ b/win/C#/Controls/PictureSettings.cs @@ -1,3 +1,9 @@ +/* PictureSetting.cs $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
using System;
using System.ComponentModel;
using System.Drawing;
diff --git a/win/C#/Controls/Subtitles.cs b/win/C#/Controls/Subtitles.cs index 4fac297e5..fb179bba2 100644 --- a/win/C#/Controls/Subtitles.cs +++ b/win/C#/Controls/Subtitles.cs @@ -1,8 +1,15 @@ -using System;
+/* Subtitles.cs $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using Handbrake.Functions;
+using Handbrake.Model;
namespace Handbrake.Controls
{
@@ -10,7 +17,7 @@ namespace Handbrake.Controls {
readonly IDictionary<string, string> LangMap = new Dictionary<string, string>();
List<SubtitleInfo> SubList = new List<SubtitleInfo>();
- private int _fileContainer;
+ private int FileContainer;
public Subtitles()
{
@@ -43,17 +50,17 @@ namespace Handbrake.Controls srtLangVal = srt_lang.SelectedItem.ToString();
srtCode = srt_charcode.SelectedItem.ToString();
srtOffsetMs = (int)srt_offset.Value;
- if (defaultSub == "Yes") setNoSrtDefault();
+ if (defaultSub == "Yes") SetNoSrtDefault();
} else
{
if (defaultSub == "Yes") SetNoDefault();
if (burnedVal == "Yes") SetNoBurned();
- if (_fileContainer == 0)
+ if (FileContainer == 0)
burnedVal = "Yes"; // MP4 must have bitmap subs burned in.
}
- if (_fileContainer == 0) // MP4 and M4V file extension
+ if (FileContainer == 0) // MP4 and M4V file extension
{
// Make sure we only have 1 bitmap track.
if (drp_subtitleTracks.SelectedItem != null && drp_subtitleTracks.SelectedItem.ToString().Contains("Bitmap"))
@@ -208,7 +215,7 @@ namespace Handbrake.Controls if (check_default.Checked) // Make sure we only have 1 default track
if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.Contains(".srt"))
- setNoSrtDefault();
+ SetNoSrtDefault();
else
SetNoDefault();
@@ -305,7 +312,7 @@ namespace Handbrake.Controls }
}
- private void setNoSrtDefault()
+ private void SetNoSrtDefault()
{
int c = 0;
foreach (ListViewItem item in lv_subList.Items)
@@ -411,9 +418,9 @@ namespace Handbrake.Controls }
public void SetContainer(int value)
{
- _fileContainer = value;
+ FileContainer = value;
Boolean trigger = false;
- if (_fileContainer != 1)
+ if (FileContainer != 1)
foreach (ListViewItem item in lv_subList.Items)
{
if (item.SubItems[1].Text.Contains("Bitmap"))
@@ -429,32 +436,4 @@ namespace Handbrake.Controls return SubList;
}
}
-
- public class SubtitleInfo
- {
- public string Track { get; set; }
- public string Forced { get; set; }
- public string Burned { get; set; }
- public string Default { get; set; }
- public string SrtLang { get; set; }
- public string SrtCharCode { get; set; }
- public int SrtOffset { get; set; }
- public string SrtPath { get; set; }
- public string SrtFileName { get; set; }
-
- public ListViewItem ListView
- {
- get
- {
- ListViewItem listTrack = new ListViewItem(Track);
- listTrack.SubItems.Add(Forced);
- listTrack.SubItems.Add(Burned);
- listTrack.SubItems.Add(Default);
- listTrack.SubItems.Add(SrtLang);
- listTrack.SubItems.Add(SrtCharCode);
- listTrack.SubItems.Add(SrtOffset.ToString());
- return listTrack;
- }
- }
- }
}
\ No newline at end of file |