summaryrefslogtreecommitdiffstats
path: root/win/CS/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-06-14 17:38:21 +0000
committersr55 <[email protected]>2012-06-14 17:38:21 +0000
commit92292ed049a2f87f00cad38dcb659fe6b4f68623 (patch)
tree06c8adfce3c847a943f8a4460dfdc64f2de39807 /win/CS/Controls
parentd3f5f2227d5fad9cd49f669ce8919a7857b9e964 (diff)
WinGui: Remove the legacy WinForms GUI.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4732 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Controls')
-rw-r--r--win/CS/Controls/AdvancedEncoderOpts.Designer.cs100
-rw-r--r--win/CS/Controls/AdvancedEncoderOpts.cs70
-rw-r--r--win/CS/Controls/AdvancedEncoderOpts.resx123
-rw-r--r--win/CS/Controls/AudioPanel.Designer.cs600
-rw-r--r--win/CS/Controls/AudioPanel.cs1276
-rw-r--r--win/CS/Controls/AudioPanel.resx175
-rw-r--r--win/CS/Controls/Filters.Designer.cs343
-rw-r--r--win/CS/Controls/Filters.cs469
-rw-r--r--win/CS/Controls/Filters.resx120
-rw-r--r--win/CS/Controls/PictureSettings.Designer.cs688
-rw-r--r--win/CS/Controls/PictureSettings.cs572
-rw-r--r--win/CS/Controls/PictureSettings.resx120
-rw-r--r--win/CS/Controls/Subtitles.Designer.cs442
-rw-r--r--win/CS/Controls/Subtitles.cs938
-rw-r--r--win/CS/Controls/Subtitles.resx135
-rw-r--r--win/CS/Controls/x264Panel.Designer.cs775
-rw-r--r--win/CS/Controls/x264Panel.cs1082
-rw-r--r--win/CS/Controls/x264Panel.resx241
18 files changed, 0 insertions, 8269 deletions
diff --git a/win/CS/Controls/AdvancedEncoderOpts.Designer.cs b/win/CS/Controls/AdvancedEncoderOpts.Designer.cs
deleted file mode 100644
index 4ee6d85cf..000000000
--- a/win/CS/Controls/AdvancedEncoderOpts.Designer.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-/* x264Panel.Designer.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. */
-
-namespace Handbrake.Controls
-{
- partial class AdvancedEncoderOpts
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.label43 = new System.Windows.Forms.Label();
- this.advancedQuery = new System.Windows.Forms.RichTextBox();
- this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
- this.label64 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // label43
- //
- this.label43.AutoSize = true;
- this.label43.BackColor = System.Drawing.Color.Transparent;
- this.label43.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label43.Location = new System.Drawing.Point(13, 13);
- this.label43.Name = "label43";
- this.label43.Size = new System.Drawing.Size(63, 13);
- this.label43.TabIndex = 49;
- this.label43.Text = "Advanced";
- //
- // advancedQuery
- //
- this.advancedQuery.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.advancedQuery.Location = new System.Drawing.Point(16, 53);
- this.advancedQuery.Name = "advancedQuery";
- this.advancedQuery.Size = new System.Drawing.Size(688, 128);
- this.advancedQuery.TabIndex = 80;
- this.advancedQuery.Text = "";
- //
- // ToolTip
- //
- this.ToolTip.Active = false;
- this.ToolTip.AutomaticDelay = 1000;
- this.ToolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
- //
- // label64
- //
- this.label64.AutoSize = true;
- this.label64.Location = new System.Drawing.Point(13, 35);
- this.label64.Name = "label64";
- this.label64.Size = new System.Drawing.Size(163, 13);
- this.label64.TabIndex = 81;
- this.label64.Text = "Encoder advanced option string:";
- //
- // x264Panel
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.label64);
- this.Controls.Add(this.advancedQuery);
- this.Controls.Add(this.label43);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Size = new System.Drawing.Size(720, 305);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- internal System.Windows.Forms.Label label43;
- internal System.Windows.Forms.RichTextBox advancedQuery;
- private System.Windows.Forms.ToolTip ToolTip;
- internal System.Windows.Forms.Label label64;
- }
-}
diff --git a/win/CS/Controls/AdvancedEncoderOpts.cs b/win/CS/Controls/AdvancedEncoderOpts.cs
deleted file mode 100644
index b3f42913a..000000000
--- a/win/CS/Controls/AdvancedEncoderOpts.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-/* AdvancedEncoderOpts.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. */
-
-namespace Handbrake.Controls
-{
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
- /// <summary>
- /// The x264 Panel
- /// </summary>
- public partial class AdvancedEncoderOpts : UserControl
- {
- /// <summary>
- /// The User Setting Service.
- /// </summary>
- private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AdvancedEncoderOpts"/> class.
- /// </summary>
- public AdvancedEncoderOpts()
- {
- InitializeComponent();
-
- if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.TooltipEnable))
- ToolTip.Active = true;
- }
-
- /// <summary>
- /// Gets or sets the X264 query string
- /// </summary>
- public string AdavancedQuery
- {
- get
- {
- return advancedQuery.Text;
- }
-
- set
- {
- advancedQuery.Text = value;
- }
- }
-
- /// <summary>
- /// Sets a value indicating whether IsDisabled.
- /// </summary>
- public bool IsDisabled
- {
- set
- {
- if (value)
- {
- this.advancedQuery.Enabled = false;
- this.advancedQuery.Text = "Advanced encoder option passthrough is not currently supported for the encoder you have chosen.";
- }
- else
- {
- this.advancedQuery.Enabled = true;
- this.advancedQuery.Text = string.Empty;
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/AdvancedEncoderOpts.resx b/win/CS/Controls/AdvancedEncoderOpts.resx
deleted file mode 100644
index 89a8b3473..000000000
--- a/win/CS/Controls/AdvancedEncoderOpts.resx
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/win/CS/Controls/AudioPanel.Designer.cs b/win/CS/Controls/AudioPanel.Designer.cs
deleted file mode 100644
index 3a4653853..000000000
--- a/win/CS/Controls/AudioPanel.Designer.cs
+++ /dev/null
@@ -1,600 +0,0 @@
-/* AudioPanel.Designer.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. */
-
-namespace Handbrake.Controls
-{
- partial class AudioPanel
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioPanel));
- this.audioMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.audioList_MoveToTop = new System.Windows.Forms.ToolStripMenuItem();
- this.audioList_moveup = new System.Windows.Forms.ToolStripMenuItem();
- this.audioList_movedown = new System.Windows.Forms.ToolStripMenuItem();
- this.audioList_MoveToBottom = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.audioList_remove = new System.Windows.Forms.ToolStripMenuItem();
- this.label68 = new System.Windows.Forms.Label();
- this.drp_audioEncoder = new System.Windows.Forms.ComboBox();
- this.drp_audioMix = new System.Windows.Forms.ComboBox();
- this.drp_audioTrack = new System.Windows.Forms.ComboBox();
- this.drp_audioBitrate = new System.Windows.Forms.ComboBox();
- this.drp_audioSample = new System.Windows.Forms.ComboBox();
- this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
- this.audioList = new System.Windows.Forms.DataGridView();
- this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Gain = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.ToolTips = new System.Windows.Forms.ToolTip(this.components);
- this.drp_passthruFallback = new System.Windows.Forms.ComboBox();
- this.gb_autoPassthru = new System.Windows.Forms.GroupBox();
- this.label1 = new System.Windows.Forms.Label();
- this.check_dtshd = new System.Windows.Forms.CheckBox();
- this.check_dts = new System.Windows.Forms.CheckBox();
- this.check_ac3 = new System.Windows.Forms.CheckBox();
- this.check_aac = new System.Windows.Forms.CheckBox();
- this.check_mp3 = new System.Windows.Forms.CheckBox();
- this.btn_AdvancedAudio = new System.Windows.Forms.Button();
- this.btn_addAudioTrack = new wyDay.Controls.SplitButton();
- this.AddTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnu_AddAll = new System.Windows.Forms.ToolStripMenuItem();
- this.btn_RemoveTrack = new wyDay.Controls.SplitButton();
- this.RemoveTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
- this.audioMenu.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.audioList)).BeginInit();
- this.gb_autoPassthru.SuspendLayout();
- this.AddTrackMenu.SuspendLayout();
- this.RemoveTrackMenu.SuspendLayout();
- this.SuspendLayout();
- //
- // audioMenu
- //
- this.audioMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.audioList_MoveToTop,
- this.audioList_moveup,
- this.audioList_movedown,
- this.audioList_MoveToBottom,
- this.toolStripSeparator2,
- this.audioList_remove});
- this.audioMenu.Name = "audioMenu";
- this.audioMenu.Size = new System.Drawing.Size(165, 120);
- //
- // audioList_MoveToTop
- //
- this.audioList_MoveToTop.Name = "audioList_MoveToTop";
- this.audioList_MoveToTop.Size = new System.Drawing.Size(164, 22);
- this.audioList_MoveToTop.Text = "Move to Top";
- this.audioList_MoveToTop.Click += new System.EventHandler(this.audioList_MoveToTop_Click);
- //
- // audioList_moveup
- //
- this.audioList_moveup.Name = "audioList_moveup";
- this.audioList_moveup.Size = new System.Drawing.Size(164, 22);
- this.audioList_moveup.Text = "Move Up";
- this.audioList_moveup.Click += new System.EventHandler(this.AudioList_moveup_Click);
- //
- // audioList_movedown
- //
- this.audioList_movedown.Name = "audioList_movedown";
- this.audioList_movedown.Size = new System.Drawing.Size(164, 22);
- this.audioList_movedown.Text = "Move Down";
- this.audioList_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.audioList_movedown.Click += new System.EventHandler(this.AudioList_movedown_Click);
- //
- // audioList_MoveToBottom
- //
- this.audioList_MoveToBottom.Name = "audioList_MoveToBottom";
- this.audioList_MoveToBottom.Size = new System.Drawing.Size(164, 22);
- this.audioList_MoveToBottom.Text = "Move To Bottom";
- this.audioList_MoveToBottom.Click += new System.EventHandler(this.audioList_MoveToBottom_Click);
- //
- // toolStripSeparator2
- //
- this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6);
- //
- // audioList_remove
- //
- this.audioList_remove.Name = "audioList_remove";
- this.audioList_remove.Size = new System.Drawing.Size(164, 22);
- this.audioList_remove.Text = "Remove";
- this.audioList_remove.Click += new System.EventHandler(this.AudioList_remove_Click);
- //
- // label68
- //
- this.label68.AutoSize = true;
- this.label68.BackColor = System.Drawing.Color.Transparent;
- this.label68.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label68.Location = new System.Drawing.Point(13, 13);
- this.label68.Name = "label68";
- this.label68.Size = new System.Drawing.Size(80, 13);
- this.label68.TabIndex = 49;
- this.label68.Text = "Audio Tracks";
- //
- // drp_audioEncoder
- //
- this.drp_audioEncoder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_audioEncoder.FormattingEnabled = true;
- this.drp_audioEncoder.Items.AddRange(new object[] {
- "AAC (faac)",
- "AAC (ffmpeg)",
- "MP3 (lame)",
- "Vorbis (vorbis)",
- "AC3 Passthru",
- "AC3 (ffmpeg)",
- "DTS Passthru"});
- this.drp_audioEncoder.Location = new System.Drawing.Point(191, 66);
- this.drp_audioEncoder.Name = "drp_audioEncoder";
- this.drp_audioEncoder.Size = new System.Drawing.Size(111, 21);
- this.drp_audioEncoder.TabIndex = 52;
- this.ToolTips.SetToolTip(this.drp_audioEncoder, "Set the audio codec to encode the selected track with.");
- this.drp_audioEncoder.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
- //
- // drp_audioMix
- //
- this.drp_audioMix.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_audioMix.Enabled = false;
- this.drp_audioMix.FormattingEnabled = true;
- this.drp_audioMix.Items.AddRange(new object[] {
- "Automatic",
- "None",
- "Mono",
- "Stereo",
- "Dolby Surround",
- "Dolby Pro Logic II",
- "6-channel discrete"});
- this.drp_audioMix.Location = new System.Drawing.Point(309, 66);
- this.drp_audioMix.Name = "drp_audioMix";
- this.drp_audioMix.Size = new System.Drawing.Size(147, 21);
- this.drp_audioMix.TabIndex = 54;
- this.ToolTips.SetToolTip(this.drp_audioMix, "Set the mixdown for the selected audio track.");
- this.drp_audioMix.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
- //
- // drp_audioTrack
- //
- this.drp_audioTrack.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_audioTrack.FormattingEnabled = true;
- this.drp_audioTrack.Items.AddRange(new object[] {
- "Automatic"});
- this.drp_audioTrack.Location = new System.Drawing.Point(16, 66);
- this.drp_audioTrack.Name = "drp_audioTrack";
- this.drp_audioTrack.Size = new System.Drawing.Size(170, 21);
- this.drp_audioTrack.TabIndex = 50;
- this.ToolTips.SetToolTip(this.drp_audioTrack, "The list of audio tracks available from your source.");
- this.drp_audioTrack.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
- //
- // drp_audioBitrate
- //
- this.drp_audioBitrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_audioBitrate.Enabled = false;
- this.drp_audioBitrate.FormattingEnabled = true;
- this.drp_audioBitrate.Items.AddRange(new object[] {
- "32",
- "40",
- "48",
- "56",
- "64",
- "80",
- "96",
- "112",
- "128",
- "160"});
- this.drp_audioBitrate.Location = new System.Drawing.Point(534, 66);
- this.drp_audioBitrate.Name = "drp_audioBitrate";
- this.drp_audioBitrate.Size = new System.Drawing.Size(67, 21);
- this.drp_audioBitrate.TabIndex = 58;
- this.ToolTips.SetToolTip(this.drp_audioBitrate, "Set the bitrate for the selected audio track.");
- this.drp_audioBitrate.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
- //
- // drp_audioSample
- //
- this.drp_audioSample.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_audioSample.Enabled = false;
- this.drp_audioSample.FormattingEnabled = true;
- this.drp_audioSample.Items.AddRange(new object[] {
- "Auto",
- "48",
- "44.1",
- "32",
- "24",
- "22.05"});
- this.drp_audioSample.Location = new System.Drawing.Point(461, 66);
- this.drp_audioSample.Name = "drp_audioSample";
- this.drp_audioSample.Size = new System.Drawing.Size(67, 21);
- this.drp_audioSample.TabIndex = 56;
- this.ToolTips.SetToolTip(this.drp_audioSample, "Set the samplerate for the selected audio track.");
- this.drp_audioSample.SelectedIndexChanged += new System.EventHandler(this.ControlChanged);
- //
- // AudioMenuRowHeightHack
- //
- this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.AudioMenuRowHeightHack.ImageSize = new System.Drawing.Size(1, 18);
- this.AudioMenuRowHeightHack.TransparentColor = System.Drawing.Color.Transparent;
- //
- // audioList
- //
- this.audioList.AllowUserToAddRows = false;
- this.audioList.AllowUserToResizeColumns = false;
- this.audioList.AllowUserToResizeRows = false;
- this.audioList.BackgroundColor = System.Drawing.Color.White;
- this.audioList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
- this.audioList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
- this.audioList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Source,
- this.AudioCodec,
- this.Mixdown,
- this.Samplerate,
- this.Bitrate,
- this.DRC,
- this.Gain});
- this.audioList.ContextMenuStrip = this.audioMenu;
- this.audioList.GridColor = System.Drawing.Color.White;
- this.audioList.Location = new System.Drawing.Point(16, 94);
- this.audioList.Name = "audioList";
- this.audioList.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
- this.audioList.RowHeadersVisible = false;
- this.audioList.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
- this.audioList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.audioList.ShowCellErrors = false;
- this.audioList.ShowCellToolTips = false;
- this.audioList.ShowEditingIcon = false;
- this.audioList.ShowRowErrors = false;
- this.audioList.Size = new System.Drawing.Size(685, 200);
- this.audioList.TabIndex = 67;
- this.ToolTips.SetToolTip(this.audioList, resources.GetString("audioList.ToolTip"));
- this.audioList.SelectionChanged += new System.EventHandler(this.audioList_SelectionChanged);
- //
- // Source
- //
- this.Source.DataPropertyName = "TrackDisplay";
- this.Source.FillWeight = 49.69727F;
- this.Source.HeaderText = "Source";
- this.Source.Name = "Source";
- this.Source.ReadOnly = true;
- this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Source.Width = 170;
- //
- // AudioCodec
- //
- this.AudioCodec.DataPropertyName = "AudioEncoderDisplayValue";
- this.AudioCodec.HeaderText = "Audio Codec";
- this.AudioCodec.Name = "AudioCodec";
- this.AudioCodec.ReadOnly = true;
- this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.AudioCodec.Width = 120;
- //
- // Mixdown
- //
- this.Mixdown.DataPropertyName = "AudioMixdownDisplayValue";
- this.Mixdown.FillWeight = 49.69727F;
- this.Mixdown.HeaderText = "Mixdown";
- this.Mixdown.Name = "Mixdown";
- this.Mixdown.ReadOnly = true;
- this.Mixdown.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Mixdown.Width = 150;
- //
- // Samplerate
- //
- this.Samplerate.DataPropertyName = "SampleRateDisplayValue";
- this.Samplerate.FillWeight = 49.69727F;
- this.Samplerate.HeaderText = "Samplerate";
- this.Samplerate.Name = "Samplerate";
- this.Samplerate.ReadOnly = true;
- this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Samplerate.Width = 75;
- //
- // Bitrate
- //
- this.Bitrate.DataPropertyName = "BitRateDisplayValue";
- this.Bitrate.FillWeight = 49.69727F;
- this.Bitrate.HeaderText = "Bitrate";
- this.Bitrate.Name = "Bitrate";
- this.Bitrate.ReadOnly = true;
- this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- this.Bitrate.Width = 75;
- //
- // DRC
- //
- this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.DRC.DataPropertyName = "DRC";
- this.DRC.FillWeight = 96.36334F;
- this.DRC.HeaderText = "DRC";
- this.DRC.Name = "DRC";
- this.DRC.ReadOnly = true;
- this.DRC.Resizable = System.Windows.Forms.DataGridViewTriState.True;
- this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
- //
- // Gain
- //
- this.Gain.DataPropertyName = "Gain";
- this.Gain.HeaderText = "Gain (dB)";
- this.Gain.Name = "Gain";
- this.Gain.ReadOnly = true;
- this.Gain.Width = 60;
- //
- // ToolTips
- //
- this.ToolTips.AutomaticDelay = 1500;
- //
- // drp_passthruFallback
- //
- this.drp_passthruFallback.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_passthruFallback.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.drp_passthruFallback.FormattingEnabled = true;
- this.drp_passthruFallback.Location = new System.Drawing.Point(327, 15);
- this.drp_passthruFallback.Name = "drp_passthruFallback";
- this.drp_passthruFallback.Size = new System.Drawing.Size(111, 19);
- this.drp_passthruFallback.TabIndex = 75;
- this.ToolTips.SetToolTip(this.drp_passthruFallback, "The Audio Encoder that will be used, if there is no suitable passthru option.");
- this.drp_passthruFallback.SelectedIndexChanged += new System.EventHandler(this.drp_passthruFallback_SelectedIndexChanged);
- //
- // gb_autoPassthru
- //
- this.gb_autoPassthru.Controls.Add(this.label1);
- this.gb_autoPassthru.Controls.Add(this.drp_passthruFallback);
- this.gb_autoPassthru.Controls.Add(this.check_dtshd);
- this.gb_autoPassthru.Controls.Add(this.check_dts);
- this.gb_autoPassthru.Controls.Add(this.check_ac3);
- this.gb_autoPassthru.Controls.Add(this.check_aac);
- this.gb_autoPassthru.Controls.Add(this.check_mp3);
- this.gb_autoPassthru.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.gb_autoPassthru.Location = new System.Drawing.Point(256, 19);
- this.gb_autoPassthru.Name = "gb_autoPassthru";
- this.gb_autoPassthru.Size = new System.Drawing.Size(445, 40);
- this.gb_autoPassthru.TabIndex = 74;
- this.gb_autoPassthru.TabStop = false;
- this.gb_autoPassthru.Text = "Auto Passthru";
- this.ToolTips.SetToolTip(this.gb_autoPassthru, resources.GetString("gb_autoPassthru.ToolTip"));
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label1.Location = new System.Drawing.Point(279, 18);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(42, 11);
- this.label1.TabIndex = 76;
- this.label1.Text = "Fallback:";
- //
- // check_dtshd
- //
- this.check_dtshd.AutoSize = true;
- this.check_dtshd.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_dtshd.Location = new System.Drawing.Point(214, 17);
- this.check_dtshd.Name = "check_dtshd";
- this.check_dtshd.Size = new System.Drawing.Size(60, 15);
- this.check_dtshd.TabIndex = 4;
- this.check_dtshd.Text = "DTS-HD";
- this.ToolTips.SetToolTip(this.check_dtshd, "Allow DTS-HD Passthru");
- this.check_dtshd.UseVisualStyleBackColor = true;
- this.check_dtshd.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);
- //
- // check_dts
- //
- this.check_dts.AutoSize = true;
- this.check_dts.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_dts.Location = new System.Drawing.Point(163, 17);
- this.check_dts.Name = "check_dts";
- this.check_dts.Size = new System.Drawing.Size(43, 15);
- this.check_dts.TabIndex = 3;
- this.check_dts.Text = "DTS";
- this.ToolTips.SetToolTip(this.check_dts, "Allow DTS Passthru");
- this.check_dts.UseVisualStyleBackColor = true;
- this.check_dts.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);
- //
- // check_ac3
- //
- this.check_ac3.AutoSize = true;
- this.check_ac3.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_ac3.Location = new System.Drawing.Point(111, 17);
- this.check_ac3.Name = "check_ac3";
- this.check_ac3.Size = new System.Drawing.Size(43, 15);
- this.check_ac3.TabIndex = 2;
- this.check_ac3.Text = "AC3";
- this.ToolTips.SetToolTip(this.check_ac3, "Allow AC3 Passthru");
- this.check_ac3.UseVisualStyleBackColor = true;
- this.check_ac3.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);
- //
- // check_aac
- //
- this.check_aac.AutoSize = true;
- this.check_aac.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_aac.Location = new System.Drawing.Point(58, 17);
- this.check_aac.Name = "check_aac";
- this.check_aac.Size = new System.Drawing.Size(45, 15);
- this.check_aac.TabIndex = 1;
- this.check_aac.Text = "AAC";
- this.ToolTips.SetToolTip(this.check_aac, "Allow AAC Passthru");
- this.check_aac.UseVisualStyleBackColor = true;
- this.check_aac.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);
- //
- // check_mp3
- //
- this.check_mp3.AutoSize = true;
- this.check_mp3.Font = new System.Drawing.Font("Tahoma", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.check_mp3.Location = new System.Drawing.Point(6, 17);
- this.check_mp3.Name = "check_mp3";
- this.check_mp3.Size = new System.Drawing.Size(43, 15);
- this.check_mp3.TabIndex = 0;
- this.check_mp3.Text = "MP3";
- this.ToolTips.SetToolTip(this.check_mp3, "Allow MP3 Passthru");
- this.check_mp3.UseVisualStyleBackColor = true;
- this.check_mp3.CheckedChanged += new System.EventHandler(this.autoPassthru_CheckedChanged);
- //
- // btn_AdvancedAudio
- //
- this.btn_AdvancedAudio.BackColor = System.Drawing.Color.Transparent;
- this.btn_AdvancedAudio.Enabled = false;
- this.btn_AdvancedAudio.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_AdvancedAudio.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_AdvancedAudio.Location = new System.Drawing.Point(607, 65);
- this.btn_AdvancedAudio.Name = "btn_AdvancedAudio";
- this.btn_AdvancedAudio.Size = new System.Drawing.Size(94, 23);
- this.btn_AdvancedAudio.TabIndex = 70;
- this.btn_AdvancedAudio.Text = "Advanced";
- this.btn_AdvancedAudio.UseVisualStyleBackColor = false;
- this.btn_AdvancedAudio.Click += new System.EventHandler(this.btn_AdvancedAudio_Click);
- //
- // btn_addAudioTrack
- //
- this.btn_addAudioTrack.AutoSize = true;
- this.btn_addAudioTrack.ContextMenuStrip = this.AddTrackMenu;
- this.btn_addAudioTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_addAudioTrack.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_addAudioTrack.Location = new System.Drawing.Point(16, 37);
- this.btn_addAudioTrack.Name = "btn_addAudioTrack";
- this.btn_addAudioTrack.Size = new System.Drawing.Size(92, 23);
- this.btn_addAudioTrack.SplitMenuStrip = this.AddTrackMenu;
- this.btn_addAudioTrack.TabIndex = 72;
- this.btn_addAudioTrack.Text = "Add Track";
- this.btn_addAudioTrack.UseVisualStyleBackColor = true;
- this.btn_addAudioTrack.Click += new System.EventHandler(this.AddAudioTrack_Click);
- //
- // AddTrackMenu
- //
- this.AddTrackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_AddAll});
- this.AddTrackMenu.Name = "audioMenu";
- this.AddTrackMenu.Size = new System.Drawing.Size(114, 26);
- //
- // mnu_AddAll
- //
- this.mnu_AddAll.Name = "mnu_AddAll";
- this.mnu_AddAll.Size = new System.Drawing.Size(113, 22);
- this.mnu_AddAll.Text = "Add All";
- this.mnu_AddAll.Click += new System.EventHandler(this.mnu_AddAll_Click);
- //
- // btn_RemoveTrack
- //
- this.btn_RemoveTrack.AutoSize = true;
- this.btn_RemoveTrack.ContextMenuStrip = this.RemoveTrackMenu;
- this.btn_RemoveTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_RemoveTrack.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_RemoveTrack.Location = new System.Drawing.Point(114, 37);
- this.btn_RemoveTrack.Name = "btn_RemoveTrack";
- this.btn_RemoveTrack.Size = new System.Drawing.Size(82, 23);
- this.btn_RemoveTrack.SplitMenuStrip = this.RemoveTrackMenu;
- this.btn_RemoveTrack.TabIndex = 73;
- this.btn_RemoveTrack.Text = "Remove";
- this.btn_RemoveTrack.UseVisualStyleBackColor = true;
- this.btn_RemoveTrack.Click += new System.EventHandler(this.Btn_remove_track_click);
- //
- // RemoveTrackMenu
- //
- this.RemoveTrackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_ClearAll});
- this.RemoveTrackMenu.Name = "audioMenu";
- this.RemoveTrackMenu.Size = new System.Drawing.Size(119, 26);
- //
- // mnu_ClearAll
- //
- this.mnu_ClearAll.Name = "mnu_ClearAll";
- this.mnu_ClearAll.Size = new System.Drawing.Size(118, 22);
- this.mnu_ClearAll.Text = "Clear All";
- this.mnu_ClearAll.Click += new System.EventHandler(this.Mnu_clear_all_click);
- //
- // AudioPanel
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.gb_autoPassthru);
- this.Controls.Add(this.drp_audioTrack);
- this.Controls.Add(this.btn_AdvancedAudio);
- this.Controls.Add(this.drp_audioSample);
- this.Controls.Add(this.btn_RemoveTrack);
- this.Controls.Add(this.audioList);
- this.Controls.Add(this.label68);
- this.Controls.Add(this.btn_addAudioTrack);
- this.Controls.Add(this.drp_audioBitrate);
- this.Controls.Add(this.drp_audioMix);
- this.Controls.Add(this.drp_audioEncoder);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "AudioPanel";
- this.Size = new System.Drawing.Size(720, 310);
- this.audioMenu.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.audioList)).EndInit();
- this.gb_autoPassthru.ResumeLayout(false);
- this.gb_autoPassthru.PerformLayout();
- this.AddTrackMenu.ResumeLayout(false);
- this.RemoveTrackMenu.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- internal System.Windows.Forms.Label label68;
- internal System.Windows.Forms.ComboBox drp_audioEncoder;
- internal System.Windows.Forms.ComboBox drp_audioMix;
- internal System.Windows.Forms.ComboBox drp_audioTrack;
- internal System.Windows.Forms.ComboBox drp_audioSample;
- private System.Windows.Forms.ImageList AudioMenuRowHeightHack;
- private System.Windows.Forms.ContextMenuStrip audioMenu;
- private System.Windows.Forms.ToolStripMenuItem audioList_moveup;
- private System.Windows.Forms.ToolStripMenuItem audioList_movedown;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
- private System.Windows.Forms.ToolStripMenuItem audioList_remove;
- internal System.Windows.Forms.ComboBox drp_audioBitrate;
- private System.Windows.Forms.DataGridView audioList;
- private System.Windows.Forms.ToolTip ToolTips;
- private System.Windows.Forms.Button btn_AdvancedAudio;
- private System.Windows.Forms.ToolStripMenuItem audioList_MoveToTop;
- private System.Windows.Forms.ToolStripMenuItem audioList_MoveToBottom;
- private wyDay.Controls.SplitButton btn_addAudioTrack;
- private System.Windows.Forms.ContextMenuStrip AddTrackMenu;
- private System.Windows.Forms.ToolStripMenuItem mnu_AddAll;
- private wyDay.Controls.SplitButton btn_RemoveTrack;
- private System.Windows.Forms.ContextMenuStrip RemoveTrackMenu;
- private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll;
- private System.Windows.Forms.DataGridViewTextBoxColumn Source;
- private System.Windows.Forms.DataGridViewTextBoxColumn AudioCodec;
- private System.Windows.Forms.DataGridViewTextBoxColumn Mixdown;
- private System.Windows.Forms.DataGridViewTextBoxColumn Samplerate;
- private System.Windows.Forms.DataGridViewTextBoxColumn Bitrate;
- private System.Windows.Forms.DataGridViewTextBoxColumn DRC;
- private System.Windows.Forms.DataGridViewTextBoxColumn Gain;
- private System.Windows.Forms.GroupBox gb_autoPassthru;
- private System.Windows.Forms.CheckBox check_dtshd;
- private System.Windows.Forms.CheckBox check_dts;
- private System.Windows.Forms.CheckBox check_ac3;
- private System.Windows.Forms.CheckBox check_aac;
- private System.Windows.Forms.CheckBox check_mp3;
- private System.Windows.Forms.Label label1;
- internal System.Windows.Forms.ComboBox drp_passthruFallback;
- }
-}
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
deleted file mode 100644
index 48c165158..000000000
--- a/win/CS/Controls/AudioPanel.cs
+++ /dev/null
@@ -1,1276 +0,0 @@
-/* AudioPanel.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. */
-
-namespace Handbrake.Controls
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Collections.Specialized;
- using System.ComponentModel;
- using System.Drawing;
- using System.Globalization;
- using System.Linq;
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices;
- using HandBrake.ApplicationServices.Functions;
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Model.Encoding;
- using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Services.Interfaces;
- using HandBrake.ApplicationServices.Utilities;
- using HandBrake.Interop.Model.Encoding;
-
- using Handbrake.ToolWindows;
-
- /// <summary>
- /// The AudioPanel Control
- /// </summary>
- public partial class AudioPanel : UserControl
- {
- #region Private Variables
-
- /// <summary>
- /// The User Setting Service.
- /// </summary>
- private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;
-
- /// <summary>
- /// Audio Tracks
- /// </summary>
- private readonly BindingList<AudioTrack> audioTracks = new BindingList<AudioTrack>();
-
- /// <summary>
- /// Mixdown
- /// </summary>
- private const string None = "None";
-
- /// <summary>
- /// The Advanced Audio Backing object
- /// </summary>
- private AdvancedAudio advancedAudio = new AdvancedAudio();
-
- #endregion
-
- #region Constructor and Events
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AudioPanel"/> class.
- /// </summary>
- public AudioPanel()
- {
- InitializeComponent();
-
- this.ScannedTracks = new BindingList<Audio>
- {
- AudioHelper.NoneFound
- };
-
- this.audioList.AutoGenerateColumns = false;
- this.audioList.DataSource = audioTracks;
-
- drp_audioMix.SelectedItem = "Dolby Pro Logic II";
- drp_audioSample.SelectedIndex = 1;
- drp_audioBitrate.SelectedItem = "160";
- drp_audioEncoder.SelectedItem = "AAC (faac)";
-
- drp_audioTrack.DataSource = this.ScannedTracks;
-
- // Setup Auto-Passthru Settings
- this.PassthruSettings = new AllowedPassthru();
- this.SetPassthruSettings(this.PassthruSettings);
- this.gb_autoPassthru.Visible = this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
- }
-
- /// <summary>
- /// The audio list has changed
- /// </summary>
- public event EventHandler AudioListChanged;
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets or sets ScannedTracks.
- /// </summary>
- private BindingList<Audio> ScannedTracks { get; set; }
-
- /// <summary>
- /// Gets the AudioTracks Collection
- /// </summary>
- public BindingList<AudioTrack> AudioTracks
- {
- get
- {
- return this.audioTracks;
- }
- }
-
- /// <summary>
- /// Gets or sets PassthruSettings.
- /// </summary>
- public AllowedPassthru PassthruSettings { get; set; }
-
- #endregion
-
- #region Public Methods
-
- /// <summary>
- /// Set the File Container. This funciton is used to limit the available options for each file container.
- /// </summary>
- /// <param name="path">
- /// the file path
- /// </param>
- public void SetContainer(string path)
- {
- string oldval = drp_audioEncoder.Text;
- string fallbackOldVal = drp_passthruFallback.Text;
-
- drp_audioEncoder.Items.Clear();
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Faac));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffaac));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.AacPassthru));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Lame));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Mp3Passthru));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Ac3Passthrough));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Ac3));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.DtsPassthrough));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.DtsHDPassthrough));
-
- drp_passthruFallback.Items.Clear();
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Faac));
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffaac));
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Lame));
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Ac3));
-
- if (path.Contains("MKV"))
- {
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Vorbis));
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffflac));
-
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Vorbis));
- drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffflac));
- }
-
- drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Passthrough));
-
- if (!drp_audioEncoder.Items.Contains(oldval))
- drp_audioEncoder.SelectedIndex = 0;
- else
- drp_audioEncoder.SelectedItem = oldval;
-
- if (!drp_passthruFallback.Items.Contains(fallbackOldVal))
- drp_passthruFallback.SelectedIndex = 3;
- else
- drp_passthruFallback.SelectedItem = fallbackOldVal;
- }
-
- /// <summary>
- /// Checks if the settings used required the .m4v (rather than .mp4) extension
- /// </summary>
- /// <returns>True if m4v is required</returns>
- public bool RequiresM4V()
- {
- return this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.Ac3);
- }
-
- /// <summary>
- /// Load an arraylist of AudioTrack items into the list.
- /// </summary>
- /// <param name="preset">
- /// The preset.
- /// </param>
- public void LoadTracks(Preset preset)
- {
- ClearAudioList();
-
- ObservableCollection<AudioTrack> tracks = new ObservableCollection<AudioTrack>(preset.Task.AudioTracks);
- this.PassthruSettings = preset.Task.AllowedPassthruOptions != null ? new AllowedPassthru(preset.Task.AllowedPassthruOptions) : new AllowedPassthru(false);
- this.SetPassthruSettings(this.PassthruSettings);
-
- if (this.drp_audioTrack.SelectedItem != null && this.drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description)
- return;
-
- foreach (AudioTrack track in tracks)
- {
- AudioTrack audioTrack = new AudioTrack
- {
- Encoder = track.Encoder,
- MixDown = track.MixDown,
- SampleRate = track.SampleRate,
- Bitrate = track.Bitrate,
- Gain = track.Gain,
- DRC = track.DRC,
- };
-
- if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough ||
- track.Encoder == AudioEncoder.DtsHDPassthrough || track.Encoder == AudioEncoder.AacPassthru || track.Encoder == AudioEncoder.Mp3Passthru)
- {
- audioTrack.MixDown = HandBrake.Interop.Model.Encoding.Mixdown.None;
- audioTrack.Bitrate = 0;
- }
-
- this.audioTracks.Add(audioTrack);
- }
-
- // It's a Preset, if the TrackNumber is 0, so allow the Automatic Track Selection to run after we've setup the presets audio settings.
- if (tracks.Count == 0 || tracks[0].ScannedTrack.TrackNumber == 0)
- {
- this.AutomaticTrackSelection();
- }
-
- // Make sure correct audio encoder is still selected.
- this.CheckAndFixPassthruCompatibility();
-
- if (this.AudioListChanged != null)
- this.AudioListChanged(this, new EventArgs());
- }
-
- /// <summary>
- /// Set the Track list dropdown from the parsed title captured during the scan
- /// </summary>
- /// <param name="selectedTitle">The selected title</param>
- /// <param name="preset">A preset</param>
- public void SetTrackListAfterTitleChange(Title selectedTitle, Preset preset)
- {
- // Reset
- this.AudioTracks.Clear();
- this.ScannedTracks.Clear();
-
- if (selectedTitle.AudioTracks.Count == 0)
- {
- this.ScannedTracks.Add(AudioHelper.NoneFound);
- this.drp_audioTrack.Refresh();
- drp_audioTrack.SelectedIndex = 0;
- return;
- }
-
- // Setup the Audio track source dropdown with the new audio tracks.
- this.drp_audioTrack.SelectedItem = null;
- foreach (Audio track in selectedTitle.AudioTracks)
- {
- this.ScannedTracks.Add(track);
- }
-
- drp_audioTrack.SelectedItem = this.ScannedTracks.FirstOrDefault();
-
- // Add any tracks the preset has, if there is a preset and no audio tracks in the list currently
- if (audioList.Rows.Count == 0 && preset != null)
- {
- EncodeTask parsed = QueryParserUtility.Parse(preset.Query);
- foreach (AudioTrack audioTrack in parsed.AudioTracks)
- {
- audioTrack.ScannedTrack = drp_audioTrack.SelectedItem as Audio;
- this.audioTracks.Add(audioTrack);
- }
- }
-
- if (selectedTitle.AudioTracks.Count > 0)
- {
- this.AutomaticTrackSelection();
- }
-
- // Make sure correct audio encoder is still selected.
- this.CheckAndFixPassthruCompatibility();
- }
-
- #endregion
-
- #region Control and ListView
-
- /// <summary>
- /// one of the controls has changed. Event handler
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void ControlChanged(object sender, EventArgs e)
- {
- Control ctl = (Control)sender;
-
- // Some Sanity Checking
- if (audioList.SelectedRows.Count == 0)
- {
- RefreshEnabledControls();
- return;
- }
-
- AudioTrack track = audioList.SelectedRows[0].DataBoundItem as AudioTrack;
- if (track == null)
- {
- return;
- }
-
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;
-
- // Handle the changed control and selected audio track.
- switch (ctl.Name)
- {
- case "drp_audioTrack":
- if (audioList.Rows.Count != 0 && audioList.SelectedRows.Count != 0 && drp_audioTrack.SelectedItem != null)
- {
- track.ScannedTrack = drp_audioTrack.SelectedItem as Audio;
-
- // Correct bad passthru option
- if (this.IsIncompatiblePassthru(track))
- {
- AudioEncoder encoder = GetCompatiblePassthru(track, false);
- drp_audioEncoder.SelectedItem = EnumHelper<AudioEncoder>.GetDisplay(encoder);
- }
- }
- break;
- case "drp_audioEncoder":
- SetMixDown(EnumHelper<Mixdown>.GetDisplay(track.MixDown));
-
- // Configure the widgets with values
- if (drp_audioEncoder.Text.Contains("Passthru"))
- {
- track.Gain = 0;
- track.DRC = 0;
- }
-
- this.RefreshEnabledControls();
-
- if (drp_audioEncoder.Text.Contains("Flac"))
- {
- drp_audioBitrate.Enabled = false;
- track.Bitrate = 0;
- }
-
- // Update an item in the Audio list if required.
- track.Encoder = EnumHelper<AudioEncoder>.GetValue(drp_audioEncoder.Text);
-
- // Correct bad passthru option
- if (this.IsIncompatiblePassthru(track))
- {
- AudioEncoder encoder = GetCompatiblePassthru(track, false);
- drp_audioEncoder.SelectedItem = EnumHelper<AudioEncoder>.GetDisplay(encoder);
- }
- break;
- case "drp_audioMix":
- SetBitrate(track.Bitrate);
-
- if (drp_audioMix.SelectedItem != null)
- {
- track.MixDown = EnumHelper<Mixdown>.GetValue(drp_audioMix.Text);
- }
-
- break;
- case "drp_audioSample":
-
- double samplerate;
- double.TryParse(drp_audioSample.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out samplerate);
- track.SampleRate = samplerate;
- break;
- case "drp_audioBitrate":
- // Update an item in the Audio list if required.
- int bitrate;
- int.TryParse(drp_audioBitrate.Text, out bitrate);
-
- track.Bitrate = bitrate;
- break;
- }
-
- audioList.Refresh();
- }
-
- /// <summary>
- /// The Audio List selected index changed event handler
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void audioList_SelectionChanged(object sender, EventArgs e)
- {
- // Set the dropdown controls based on the selected item in the Audio List.
- if (audioList.Rows.Count != 0 && audioList.SelectedRows.Count != 0)
- {
- AudioTrack track = audioList.SelectedRows[0].DataBoundItem as AudioTrack;
- if (track != null)
- {
- drp_audioTrack.SelectedItem = track.ScannedTrack;
- drp_audioEncoder.SelectedItem = EnumHelper<AudioEncoder>.GetDisplay(track.Encoder);
- drp_audioMix.SelectedItem = EnumHelper<Mixdown>.GetDisplay(track.MixDown);
- drp_audioSample.SelectedItem = track.SampleRateDisplayValue;
- drp_audioBitrate.SelectedItem = track.BitRateDisplayValue;
-
- // Set the Advanced Control.
- if (!advancedAudio.IsDisposed)
- advancedAudio.Track = track;
-
- this.RefreshEnabledControls();
- }
- }
- }
-
- #endregion
-
- #region Track Controls
-
- /// <summary>
- /// The Add Audio Track button event handler
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void AddAudioTrack_Click(object sender, EventArgs e)
- {
- if (drp_audioTrack.Text == "None Found")
- {
- MessageBox.Show(
- "Your source appears to have no audio tracks, or no tracks in a format that HandBrake supports.",
- "Warning",
- MessageBoxButtons.OK,
- MessageBoxIcon.Warning);
- return;
- }
-
- // Get Some Values
- int bitrate;
- double samplerate;
-
- int.TryParse(drp_audioBitrate.Text, out bitrate);
- double.TryParse(drp_audioSample.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out samplerate);
-
- // Create the Model
- AudioTrack track = new AudioTrack
- {
- ScannedTrack = this.drp_audioTrack.SelectedItem as Audio,
- Encoder = EnumHelper<AudioEncoder>.GetValue(this.drp_audioEncoder.Text),
- MixDown = EnumHelper<Mixdown>.GetValue(this.drp_audioMix.Text),
- SampleRate = samplerate,
- Bitrate = bitrate,
- Gain = 0,
- DRC = 0,
- };
-
- // Force an update of the mixdown control
- this.SetMixDown(EnumHelper<Mixdown>.GetDisplay(track.MixDown));
- this.SetBitrate(track.Bitrate);
-
- this.audioTracks.Add(track);
-
- // The Audio List has changed to raise the event.
- if (this.AudioListChanged != null)
- this.AudioListChanged(this, new EventArgs());
-
- // Select the newly added track and select the control
- audioList.ClearSelection();
- audioList.Rows[audioList.Rows.Count - 1].Selected = true;
- audioList.Select();
- }
-
- /// <summary>
- /// Add all the Audio Tracks that are not currently on the Lust
- /// </summary>
- /// <param name="sender">The Sender</param>
- /// <param name="e">The EventArgs</param>
- private void mnu_AddAll_Click(object sender, EventArgs e)
- {
- if (drp_audioTrack.Text == "None Found")
- {
- MessageBox.Show(
- "Your source appears to have no audio tracks, or no tracks in a format that HandBrake supports.",
- "Warning",
- MessageBoxButtons.OK,
- MessageBoxIcon.Warning);
- return;
- }
-
- bool trackAdded = false;
- foreach (Audio sourceTrack in this.ScannedTracks)
- {
- // Check if the Track already exists on the list. If it does, skip to the next
- bool foundTrack = false;
- foreach (AudioTrack currentTrack in this.AudioTracks)
- {
- if (currentTrack.Track.HasValue && currentTrack.Track.Value == sourceTrack.TrackNumber)
- {
- // Set a flag to indicate we've found a track
- foundTrack = true;
- continue;
- }
- }
-
- if (foundTrack)
- {
- // Skip to the nxet Source Track, We already have this one in the list.
- continue;
- }
-
- // Create the Model
- AudioTrack track = new AudioTrack
- {
- ScannedTrack = sourceTrack,
- };
-
- this.audioTracks.Add(track);
- trackAdded = true;
- }
-
- // If we added a track, then fire the event
- if (trackAdded)
- {
- // The Audio List has changed to raise the event.
- if (this.AudioListChanged != null)
- this.AudioListChanged(this, new EventArgs());
- }
- }
-
- /// <summary>
- /// Remove an Audio Track
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void Btn_remove_track_click(object sender, EventArgs e)
- {
- RemoveTrack();
- }
-
- /// <summary>
- /// Clear all audio tracks
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void Mnu_clear_all_click(object sender, EventArgs e)
- {
- this.ClearAudioList();
- }
-
- #endregion
-
- #region Audio List Menu
-
- /// <summary>
- /// The Audio List Move Up menu item
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void AudioList_moveup_Click(object sender, EventArgs e)
- {
- MoveTrack(true);
- }
-
- /// <summary>
- /// The audio list move down menu item
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void AudioList_movedown_Click(object sender, EventArgs e)
- {
- MoveTrack(false);
- }
-
- /// <summary>
- /// The audio list remove menu item
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void AudioList_remove_Click(object sender, EventArgs e)
- {
- RemoveTrack();
- }
-
- /// <summary>
- /// Move to Top
- /// </summary>
- /// <param name="sender">The Sender</param>
- /// <param name="e">The Event Args</param>
- private void audioList_MoveToTop_Click(object sender, EventArgs e)
- {
- MoveTo(true);
- }
-
- /// <summary>
- /// Move to Bottom
- /// </summary>
- /// <param name="sender">The Sender</param>
- /// <param name="e">The Event Args</param>
- private void audioList_MoveToBottom_Click(object sender, EventArgs e)
- {
- this.MoveTo(false);
- }
-
- #endregion
-
- #region Private Functions
-
- /// <summary>
- /// Refresh the enabled controls
- /// </summary>
- private void RefreshEnabledControls()
- {
- // Configure the widgets with values
- if (drp_audioEncoder.Text.Contains("Passthru"))
- {
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;
- }
- else
- {
- drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;
- }
-
- if (drp_audioEncoder.Text.Contains("Flac"))
- {
- drp_audioBitrate.Enabled = false;
- }
- }
-
- /// <summary>
- /// Attempt to automatically select the correct audio tracks based on the users settings.
- /// </summary>
- private void AutomaticTrackSelection()
- {
- // Sanity check that we have Audio Tracks and if not, clear the track list.
- if (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description)
- {
- this.AudioTracks.Clear();
- return;
- }
-
- if (this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage) == "Any")
- {
- // If we have Any as the preferred Language, just set the first track to all audio tracks.
- drp_audioTrack.SelectedIndex = 0;
- foreach (AudioTrack track in this.audioTracks)
- {
- if (this.drp_audioTrack.SelectedItem != null)
- {
- track.ScannedTrack = this.drp_audioTrack.SelectedItem as Audio;
- }
- }
-
- }
- else
- {
- // Otherwise, set all the tracks to the first track of the preferred language.
- foreach (Audio item in drp_audioTrack.Items)
- {
- if (item.Language.Contains(this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage)))
- {
- drp_audioTrack.SelectedItem = item;
- break;
- }
- }
-
- foreach (AudioTrack track in this.audioTracks)
- {
- if (this.drp_audioTrack.SelectedItem != null)
- {
- track.ScannedTrack = this.drp_audioTrack.SelectedItem as Audio;
- }
- }
- }
-
- // Array with the Index numbers of the prefered and additional languages.
- // This allows to have for each language the order in which they appear in the DVD list.
- Dictionary<String, ArrayList> languageIndex = new Dictionary<String, ArrayList>();
-
- // Now add any additional Langauges tracks on top of the presets tracks.
- int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeAudio);
- ArrayList languageOrder = new ArrayList(); // This is used to keep the Prefered Language in the front and the other languages in order. TODO this is no longer required, refactor this.
- if (mode > 1)
- {
- foreach (string item in this.UserSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))
- {
- if (!languageIndex.ContainsKey(item))
- {
- languageIndex.Add(item, new ArrayList());
- languageOrder.Add(item);
- }
- }
-
- bool elementFound = false;
- int i = 0;
- foreach (object item in drp_audioTrack.Items)
- {
- foreach (KeyValuePair<String, ArrayList> kvp in languageIndex)
- {
- if (item.ToString().Contains(kvp.Key))
- {
- // Only the first Element if the "Only One Audio"-option is chosen.
- if (!this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AddOnlyOneAudioPerLanguage) || kvp.Value.Count == 0)
- {
- kvp.Value.Add(i);
- }
-
- elementFound = true;
- }
- }
-
- i++;
- }
-
- // There are no additional Languages, so we don't need to continue processing.
- if (!elementFound)
- {
- // return;
- }
- }
-
- switch (mode)
- {
- case 1: // Adding all remaining audio tracks
- this.mnu_AddAll_Click(this, EventArgs.Empty);
- break;
- case 2: // Add Langauges tracks for the additional languages selected, in-order.
- audioList.ClearSelection();
- foreach (string item in languageOrder)
- {
- if (languageIndex[item].Count > 0)
- {
- foreach (int i in languageIndex[item])
- {
- drp_audioTrack.SelectedIndex = i;
- if (drp_audioTrack.SelectedItem != null)
- {
- Audio track = drp_audioTrack.SelectedItem as Audio;
- if (track != null)
- {
- if (!TrackExists(track))
- {
- this.AddAudioTrack_Click(this, EventArgs.Empty);
- audioList.ClearSelection();
- }
- }
- }
- }
- }
- }
- break;
- }
- }
-
- /// <summary>
- /// Clear the audio list
- /// </summary>
- private void ClearAudioList()
- {
- this.AudioTracks.Clear();
-
- //drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true;
-
- if (this.AudioListChanged != null)
- this.AudioListChanged(this, new EventArgs());
- }
-
- /// <summary>
- /// Remove an audio track from the list
- /// </summary>
- private void RemoveTrack()
- {
- // Remove the Item and reselect the control if the following conditions are met.
- if (audioList.SelectedRows.Count != 0)
- {
- // The Audio List is about to change so raise the event.
- if (this.AudioListChanged != null)
- this.AudioListChanged(this, new EventArgs());
-
- // Record the current selected index.
- int currentPosition = audioList.SelectedRows[0].Index;
-
- audioList.Rows.Remove(audioList.SelectedRows[0]);
-
- // Now reslect the correct item and give focus to the audio list.
- if (audioList.Rows.Count != 0)
- {
- audioList.ClearSelection();
- if (currentPosition <= (audioList.Rows.Count - 1))
- audioList.Rows[currentPosition].Selected = true;
- else if (currentPosition > (audioList.Rows.Count - 1))
- audioList.Rows[audioList.Rows.Count - 1].Selected = true;
-
- audioList.Select();
- }
- }
- }
-
- /// <summary>
- /// Move an audio track up or down the audio list
- /// </summary>
- /// <param name="up">
- /// The up.
- /// </param>
- private void MoveTrack(bool up)
- {
- if (audioList.SelectedRows.Count == 0) return;
-
- DataGridViewRow item = audioList.SelectedRows[0];
- AudioTrack track = item.DataBoundItem as AudioTrack;
- int index = item.Index;
-
- if (up) index--;
- else index++;
-
- if (index < audioList.Rows.Count || (audioList.Rows.Count > index && index >= 0))
- {
- this.AudioTracks.Remove(track);
- this.audioTracks.Insert(index, track);
- this.audioList.ClearSelection();
- this.audioList.Rows[index].Selected = true;
- }
- }
-
- /// <summary>
- /// Move to
- /// </summary>
- /// <param name="top">
- /// The top.
- /// </param>
- private void MoveTo(bool top)
- {
- if (audioList.SelectedRows.Count == 0) return;
-
- DataGridViewRow item = audioList.SelectedRows[0];
- AudioTrack track = item.DataBoundItem as AudioTrack;
- int index = item.Index;
-
- if (top) index = 0;
- else index = this.audioList.Rows.Count - 1;
-
- if (index < audioList.Rows.Count || (audioList.Rows.Count > index && index >= 0))
- {
- this.AudioTracks.Remove(track);
- this.audioTracks.Insert(index, track);
- this.audioList.ClearSelection();
- this.audioList.Rows[index].Selected = true;
- }
- }
-
- /// <summary>
- /// Set the bitrate dropdown
- /// </summary>
- /// <param name="currentValue">
- /// The current Value.
- /// </param>
- private void SetBitrate(int currentValue)
- {
- int max = 0;
- string defaultRate = "160";
-
- // Remove defaults
- drp_audioBitrate.Items.Remove("Auto");
- drp_audioBitrate.Items.Remove("192");
- drp_audioBitrate.Items.Remove("224");
- drp_audioBitrate.Items.Remove("256");
- drp_audioBitrate.Items.Remove("320");
- drp_audioBitrate.Items.Remove("384");
- drp_audioBitrate.Items.Remove("448");
- drp_audioBitrate.Items.Remove("640");
- drp_audioBitrate.Items.Remove("768");
- drp_audioBitrate.Items.Remove("0");
-
- // Find Max and Defaults based on encoders
- switch (drp_audioEncoder.Text)
- {
- case "AAC (faac)":
- case "AAC (ffmpeg)":
- max = drp_audioMix.Text.Contains("6-channel") ? 768 : 320;
- defaultRate = "160";
- break;
- case "MP3 (lame)":
- max = 320;
- defaultRate = "160";
- break;
- case "Vorbis (vorbis)":
- defaultRate = "160";
- max = 384;
- break;
- case "AC3 (ffmpeg)":
- defaultRate = "640";
- max = 640;
- break;
- case "Flac (ffmpeg)":
- defaultRate = "0";
- drp_audioBitrate.Items.Add("0");
- max = 0;
- break;
- }
-
- if (drp_audioEncoder.Text.Contains("Passthru"))
- {
- drp_audioBitrate.Items.Add("Auto");
- defaultRate = "Auto";
- drp_audioSample.SelectedItem = "Auto";
- }
-
- // Re-add appropiate options
- if (max > 160)
- {
- drp_audioBitrate.Items.Add("192");
- drp_audioBitrate.Items.Add("224");
- drp_audioBitrate.Items.Add("256");
- drp_audioBitrate.Items.Add("320");
- }
-
- if (max > 320)
- {
- drp_audioBitrate.Items.Add("384");
- }
-
- if (max >= 640)
- {
- drp_audioBitrate.Items.Add("448");
- drp_audioBitrate.Items.Add("640");
- }
-
- if (max == 768)
- {
- drp_audioBitrate.Items.Add("768");
- }
-
- // Set the Current Value, or default value if the value is out of bounds
-
- if (currentValue <= max && currentValue != 0)
- {
- drp_audioBitrate.SelectedItem = currentValue.ToString();
- }
- else
- {
- drp_audioBitrate.SelectedItem = defaultRate;
- }
- }
-
- /// <summary>
- /// Set the mixdown dropdown
- /// </summary>
- /// <param name="currentMixdown">
- /// The current Mixdown.
- /// </param>
- private void SetMixDown(string currentMixdown)
- {
- drp_audioMix.Items.Clear();
- drp_audioMix.Items.Add("Mono");
- drp_audioMix.Items.Add("Stereo");
- drp_audioMix.Items.Add("Dolby Surround");
- drp_audioMix.Items.Add("Dolby Pro Logic II");
- drp_audioMix.Items.Add("6-channel discrete");
- drp_audioMix.Items.Add(None);
-
- switch (drp_audioEncoder.Text)
- {
- case "AAC (faac)":
- case "AAC (ffmpeg)":
- drp_audioMix.Items.Remove(None);
- drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
- break;
- case "MP3 (lame)":
- drp_audioMix.Items.Remove("6-channel discrete");
- drp_audioMix.Items.Remove(None);
- drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
- break;
- case "Vorbis (vorbis)":
- drp_audioMix.Items.Remove(None);
- drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
- break;
- case "AC3 (ffmpeg)":
- drp_audioMix.Items.Remove(None);
- drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
- break;
- case "AC3 Passthru":
- case "DTS Passthru":
- case "DTS-HD Passthru":
- case "AAC Passthru":
- case "MP3 Passthru":
- case "Auto Passthru":
- drp_audioMix.SelectedItem = None;
- break;
- }
-
- if (drp_audioMix.SelectedItem == null)
- {
- drp_audioMix.SelectedItem = "Dolby Pro Logic II";
- }
- }
-
- /// <summary>
- /// Check if a track already exists
- /// </summary>
- /// <param name="sourceTrack">
- /// The source track.
- /// </param>
- /// <returns>
- /// True if it does
- /// </returns>
- private bool TrackExists(Audio sourceTrack)
- {
- foreach (AudioTrack currentTrack in this.AudioTracks)
- {
- if (currentTrack.Track.HasValue && currentTrack.Track.Value == sourceTrack.TrackNumber)
- {
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// For a given Audio Track, is the chosen Passthru option supported
- /// </summary>
- /// <param name="track">
- /// The track.
- /// </param>
- /// <returns>
- /// True if it is.
- /// </returns>
- private bool IsIncompatiblePassthru(AudioTrack track)
- {
- if (track.ScannedTrack == null || string.IsNullOrEmpty(track.ScannedTrack.Format))
- {
- return false;
- }
-
-
- // If the track isn't AC3, and the encoder is, change it.
- if (track.Encoder == AudioEncoder.Ac3Passthrough && !track.ScannedTrack.Format.Contains("AC3"))
- {
- return true;
- }
-
- // If the track isn't DTS, and the encoder is, change it.
- if (track.Encoder == AudioEncoder.DtsPassthrough || track.Encoder == AudioEncoder.DtsHDPassthrough
- && !track.ScannedTrack.Format.Contains("DTS"))
- {
- return true;
- }
-
- // If the track isn't AAC, and the encoder is, change it.
- if (track.Encoder == AudioEncoder.AacPassthru && !track.ScannedTrack.Format.Contains("aac"))
- {
- return true;
- }
-
- // If the track isn't MP3, and the encoder is, change it.
- if (track.Encoder == AudioEncoder.Mp3Passthru && !track.ScannedTrack.Format.Contains("mp3"))
- {
- return true;
- }
-
- return false;
- }
-
- /// <summary>
- /// Get a compatible passthru, or default to aac.
- /// </summary>
- /// <param name="track">
- /// The track.
- /// </param>
- /// <param name="useAutoPassthruOptions">
- /// The use Auto Passthru Options.
- /// </param>
- /// <returns>
- /// AN Audio encoder.
- /// </returns>
- private AudioEncoder GetCompatiblePassthru(AudioTrack track, bool useAutoPassthruOptions)
- {
- if (useAutoPassthruOptions)
- {
- if (track.ScannedTrack.Format.Contains("AC3") && this.check_ac3.Checked)
- {
- return AudioEncoder.Ac3Passthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("DTS") && this.check_dts.Checked)
- {
- return AudioEncoder.DtsPassthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("DTS-HD") && this.check_dtshd.Checked)
- {
- return AudioEncoder.DtsPassthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("aac") && this.check_aac.Checked)
- {
- return AudioEncoder.AacPassthru;
- }
-
- if (track.ScannedTrack.Format.Contains("mp3") && this.check_mp3.Checked)
- {
- return AudioEncoder.Mp3Passthru;
- }
- }
- else
- {
- if (track.ScannedTrack.Format.Contains("AC3"))
- {
- return AudioEncoder.Ac3Passthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("DTS"))
- {
- return AudioEncoder.DtsPassthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("DTS-HD"))
- {
- return AudioEncoder.DtsPassthrough;
- }
-
- if (track.ScannedTrack.Format.Contains("aac"))
- {
- return AudioEncoder.AacPassthru;
- }
-
- if (track.ScannedTrack.Format.Contains("mp3"))
- {
- return AudioEncoder.Mp3Passthru;
- }
- }
-
- return EnumHelper<AudioEncoder>.GetValue(drp_passthruFallback.SelectedItem.ToString());
- }
-
- /// <summary>
- /// Fix any invalid passthru problems.
- /// </summary>
- private void CheckAndFixPassthruCompatibility()
- {
- // Make sure correct audio encoder is still selected.
- foreach (AudioTrack track in this.audioTracks)
- {
- if (this.IsIncompatiblePassthru(track))
- {
- track.Encoder = GetCompatiblePassthru(track, true);
- }
- }
- }
-
- /// <summary>
- /// Setup the Passthru Settings Panel
- /// </summary>
- /// <param name="settings">
- /// The settings.
- /// </param>
- private void SetPassthruSettings(AllowedPassthru settings)
- {
- if (settings == null)
- {
- settings = this.PassthruSettings;
- }
-
- this.check_aac.Checked = settings.AudioAllowAACPass;
- this.check_mp3.Checked = settings.AudioAllowMP3Pass;
- this.check_ac3.Checked = settings.AudioAllowAC3Pass;
- this.check_dts.Checked = settings.AudioAllowDTSPass;
- this.check_dtshd.Checked = settings.AudioAllowDTSHDPass;
- this.drp_passthruFallback.SelectedItem = EnumHelper<AudioEncoder>.GetDisplay(settings.AudioEncoderFallback);
- }
-
- #endregion
-
- /// <summary>
- /// Open the Advanced Audio Settings UI
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void btn_AdvancedAudio_Click(object sender, EventArgs e)
- {
- if (audioList.SelectedRows.Count == 0)
- {
- MessageBox.Show(
- "Please select an audio track.", "No Track Selected", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
-
- if (advancedAudio.IsDisposed)
- {
- advancedAudio = new AdvancedAudio { Track = this.audioList.SelectedRows[0].DataBoundItem as AudioTrack };
- }
-
- advancedAudio.Show();
- }
-
- /// <summary>
- /// Handle changes in the Checked Passthru Options
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The EventArgs.
- /// </param>
- private void autoPassthru_CheckedChanged(object sender, EventArgs e)
- {
- this.PassthruSettings.IsEnabled = true;
- if (sender == this.check_mp3)
- {
- this.PassthruSettings.AudioAllowMP3Pass = this.check_mp3.Checked;
- }
-
- if (sender == this.check_aac)
- {
- this.PassthruSettings.AudioAllowAACPass = this.check_aac.Checked;
- }
-
- if (sender == this.check_ac3)
- {
- this.PassthruSettings.AudioAllowAC3Pass = this.check_ac3.Checked;
- }
-
- if (sender == this.check_dts)
- {
- this.PassthruSettings.AudioAllowDTSPass = this.check_dts.Checked;
- }
-
- if (sender == this.check_dtshd)
- {
- this.PassthruSettings.AudioAllowDTSHDPass = this.check_dtshd.Checked;
- }
- }
-
- /// <summary>
- /// Set the fallback encoder
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void drp_passthruFallback_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.PassthruSettings.IsEnabled = true;
- this.PassthruSettings.AudioEncoderFallback =
- EnumHelper<AudioEncoder>.GetValue(drp_passthruFallback.SelectedItem.ToString());
- }
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/AudioPanel.resx b/win/CS/Controls/AudioPanel.resx
deleted file mode 100644
index 085fa5c90..000000000
--- a/win/CS/Controls/AudioPanel.resx
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="audioMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>216, 16</value>
- </metadata>
- <metadata name="ToolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>330, 16</value>
- </metadata>
- <metadata name="AudioMenuRowHeightHack.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>35, 17</value>
- </metadata>
- <metadata name="Source.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="AudioCodec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="Mixdown.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="Samplerate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="Bitrate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="DRC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <metadata name="Gain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
- <data name="audioList.ToolTip" xml:space="preserve">
- <value>The audio tracks to be encoded into the output file.
-
-Note: When a track is selected on this grid, the dropdown controls above will alter the selected track.
-
-If you want to add multiple tracks, you can hit the add button several times, then select each track
-and alter its settings after adding them.</value>
- </data>
- <data name="gb_autoPassthru.ToolTip" xml:space="preserve">
- <value>Controls the behaviour of the Audio Codec dropdown when passthru options are selected.
-
-When an incorrect passthru option is selected, it will try to fall back to the correct one if the
-format checkbox in the "Auto Passthru" section is checked.
-
-If there is no suitable passthru option, it will use the "Fallkback" encoder.
-
-These settings are global to all Audio Tracks.
-These settings are stored in the presets.</value>
- </data>
- <metadata name="AddTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>427, 16</value>
- </metadata>
- <metadata name="RemoveTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>561, 16</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/win/CS/Controls/Filters.Designer.cs b/win/CS/Controls/Filters.Designer.cs
deleted file mode 100644
index 6b415f3b9..000000000
--- a/win/CS/Controls/Filters.Designer.cs
+++ /dev/null
@@ -1,343 +0,0 @@
-namespace Handbrake.Controls
-{
- partial class Filters
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.text_customDT = new System.Windows.Forms.TextBox();
- this.label18 = new System.Windows.Forms.Label();
- this.drop_detelecine = new System.Windows.Forms.ComboBox();
- this.text_customDC = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.drop_decomb = new System.Windows.Forms.ComboBox();
- this.text_customDI = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.drop_deinterlace = new System.Windows.Forms.ComboBox();
- this.text_customDN = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.drop_denoise = new System.Windows.Forms.ComboBox();
- this.slider_deblock = new System.Windows.Forms.TrackBar();
- this.check_grayscale = new System.Windows.Forms.CheckBox();
- this.label8 = new System.Windows.Forms.Label();
- this.lbl_deblockVal = new System.Windows.Forms.Label();
- this.label68 = new System.Windows.Forms.Label();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- ((System.ComponentModel.ISupportInitialize)(this.slider_deblock)).BeginInit();
- this.tableLayoutPanel1.SuspendLayout();
- this.SuspendLayout();
- //
- // text_customDT
- //
- this.text_customDT.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.text_customDT.Location = new System.Drawing.Point(251, 3);
- this.text_customDT.Name = "text_customDT";
- this.text_customDT.Size = new System.Drawing.Size(115, 21);
- this.text_customDT.TabIndex = 47;
- this.text_customDT.Visible = false;
- //
- // label18
- //
- this.label18.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label18.AutoSize = true;
- this.label18.BackColor = System.Drawing.Color.Transparent;
- this.label18.Location = new System.Drawing.Point(0, 7);
- this.label18.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(61, 13);
- this.label18.TabIndex = 46;
- this.label18.Text = "Detelecine:";
- //
- // drop_detelecine
- //
- this.drop_detelecine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.drop_detelecine.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_detelecine.FormattingEnabled = true;
- this.drop_detelecine.Items.AddRange(new object[] {
- "Off",
- "Custom",
- "Default"});
- this.drop_detelecine.Location = new System.Drawing.Point(71, 3);
- this.drop_detelecine.Name = "drop_detelecine";
- this.drop_detelecine.Size = new System.Drawing.Size(174, 21);
- this.drop_detelecine.TabIndex = 45;
- this.drop_detelecine.SelectedIndexChanged += new System.EventHandler(this.DropDetelecineSelectedIndexChanged);
- //
- // text_customDC
- //
- this.text_customDC.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.text_customDC.Location = new System.Drawing.Point(251, 30);
- this.text_customDC.Name = "text_customDC";
- this.text_customDC.Size = new System.Drawing.Size(115, 21);
- this.text_customDC.TabIndex = 50;
- this.text_customDC.Visible = false;
- //
- // label1
- //
- this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label1.AutoSize = true;
- this.label1.BackColor = System.Drawing.Color.Transparent;
- this.label1.Location = new System.Drawing.Point(0, 34);
- this.label1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(49, 13);
- this.label1.TabIndex = 49;
- this.label1.Text = "Decomb:";
- //
- // drop_decomb
- //
- this.drop_decomb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.drop_decomb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_decomb.FormattingEnabled = true;
- this.drop_decomb.Items.AddRange(new object[] {
- "Off",
- "Custom",
- "Default",
- "Fast",
- "Bob"});
- this.drop_decomb.Location = new System.Drawing.Point(71, 30);
- this.drop_decomb.Name = "drop_decomb";
- this.drop_decomb.Size = new System.Drawing.Size(174, 21);
- this.drop_decomb.TabIndex = 48;
- this.drop_decomb.SelectedIndexChanged += new System.EventHandler(this.DropDecombSelectedIndexChanged);
- //
- // text_customDI
- //
- this.text_customDI.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.text_customDI.Location = new System.Drawing.Point(251, 57);
- this.text_customDI.Name = "text_customDI";
- this.text_customDI.Size = new System.Drawing.Size(115, 21);
- this.text_customDI.TabIndex = 53;
- this.text_customDI.Visible = false;
- //
- // label2
- //
- this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label2.AutoSize = true;
- this.label2.BackColor = System.Drawing.Color.Transparent;
- this.label2.Location = new System.Drawing.Point(0, 61);
- this.label2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(65, 13);
- this.label2.TabIndex = 52;
- this.label2.Text = "Deinterlace:";
- //
- // drop_deinterlace
- //
- this.drop_deinterlace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.drop_deinterlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_deinterlace.FormattingEnabled = true;
- this.drop_deinterlace.Items.AddRange(new object[] {
- "Off",
- "Custom",
- "Fast",
- "Slow",
- "Slower",
- "Bob"});
- this.drop_deinterlace.Location = new System.Drawing.Point(71, 57);
- this.drop_deinterlace.Name = "drop_deinterlace";
- this.drop_deinterlace.Size = new System.Drawing.Size(174, 21);
- this.drop_deinterlace.TabIndex = 51;
- this.drop_deinterlace.SelectedIndexChanged += new System.EventHandler(this.DropDeinterlaceSelectedIndexChanged);
- //
- // text_customDN
- //
- this.text_customDN.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.text_customDN.Location = new System.Drawing.Point(251, 84);
- this.text_customDN.Name = "text_customDN";
- this.text_customDN.Size = new System.Drawing.Size(115, 21);
- this.text_customDN.TabIndex = 56;
- this.text_customDN.Visible = false;
- //
- // label3
- //
- this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label3.AutoSize = true;
- this.label3.BackColor = System.Drawing.Color.Transparent;
- this.label3.Location = new System.Drawing.Point(0, 88);
- this.label3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(49, 13);
- this.label3.TabIndex = 55;
- this.label3.Text = "Denoise:";
- //
- // drop_denoise
- //
- this.drop_denoise.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.drop_denoise.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_denoise.FormattingEnabled = true;
- this.drop_denoise.Items.AddRange(new object[] {
- "Off",
- "Custom",
- "Weak",
- "Medium",
- "Strong"});
- this.drop_denoise.Location = new System.Drawing.Point(71, 84);
- this.drop_denoise.Name = "drop_denoise";
- this.drop_denoise.Size = new System.Drawing.Size(174, 21);
- this.drop_denoise.TabIndex = 54;
- this.drop_denoise.SelectedIndexChanged += new System.EventHandler(this.DropDenoiseSelectedIndexChanged);
- //
- // slider_deblock
- //
- this.slider_deblock.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.slider_deblock.BackColor = System.Drawing.SystemColors.Window;
- this.slider_deblock.Location = new System.Drawing.Point(71, 111);
- this.slider_deblock.Maximum = 15;
- this.slider_deblock.Minimum = 4;
- this.slider_deblock.Name = "slider_deblock";
- this.slider_deblock.Size = new System.Drawing.Size(174, 45);
- this.slider_deblock.TabIndex = 58;
- this.slider_deblock.Value = 4;
- this.slider_deblock.Scroll += new System.EventHandler(this.SliderDeblockScroll);
- //
- // check_grayscale
- //
- this.check_grayscale.AutoSize = true;
- this.check_grayscale.BackColor = System.Drawing.Color.Transparent;
- this.check_grayscale.Location = new System.Drawing.Point(71, 162);
- this.check_grayscale.Name = "check_grayscale";
- this.check_grayscale.Size = new System.Drawing.Size(119, 17);
- this.check_grayscale.TabIndex = 57;
- this.check_grayscale.Text = "Grayscale Encoding";
- this.check_grayscale.UseVisualStyleBackColor = false;
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.BackColor = System.Drawing.Color.Transparent;
- this.label8.Location = new System.Drawing.Point(0, 115);
- this.label8.Margin = new System.Windows.Forms.Padding(0, 7, 3, 3);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(48, 13);
- this.label8.TabIndex = 60;
- this.label8.Text = "Deblock:";
- //
- // lbl_deblockVal
- //
- this.lbl_deblockVal.AutoSize = true;
- this.lbl_deblockVal.BackColor = System.Drawing.Color.Transparent;
- this.lbl_deblockVal.Location = new System.Drawing.Point(251, 115);
- this.lbl_deblockVal.Margin = new System.Windows.Forms.Padding(3, 7, 3, 3);
- this.lbl_deblockVal.Name = "lbl_deblockVal";
- this.lbl_deblockVal.Size = new System.Drawing.Size(23, 13);
- this.lbl_deblockVal.TabIndex = 59;
- this.lbl_deblockVal.Text = "Off";
- //
- // label68
- //
- this.label68.AutoSize = true;
- this.label68.BackColor = System.Drawing.Color.Transparent;
- this.label68.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label68.Location = new System.Drawing.Point(13, 13);
- this.label68.Name = "label68";
- this.label68.Size = new System.Drawing.Size(42, 13);
- this.label68.TabIndex = 61;
- this.label68.Text = "Filters";
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.AutoSize = true;
- this.tableLayoutPanel1.ColumnCount = 3;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.Controls.Add(this.label18, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
- this.tableLayoutPanel1.Controls.Add(this.lbl_deblockVal, 2, 4);
- this.tableLayoutPanel1.Controls.Add(this.check_grayscale, 1, 5);
- this.tableLayoutPanel1.Controls.Add(this.text_customDN, 2, 3);
- this.tableLayoutPanel1.Controls.Add(this.slider_deblock, 1, 4);
- this.tableLayoutPanel1.Controls.Add(this.text_customDI, 2, 2);
- this.tableLayoutPanel1.Controls.Add(this.label2, 0, 2);
- this.tableLayoutPanel1.Controls.Add(this.text_customDC, 2, 1);
- this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
- this.tableLayoutPanel1.Controls.Add(this.text_customDT, 2, 0);
- this.tableLayoutPanel1.Controls.Add(this.label8, 0, 4);
- this.tableLayoutPanel1.Controls.Add(this.drop_detelecine, 1, 0);
- this.tableLayoutPanel1.Controls.Add(this.drop_denoise, 1, 3);
- this.tableLayoutPanel1.Controls.Add(this.drop_decomb, 1, 1);
- this.tableLayoutPanel1.Controls.Add(this.drop_deinterlace, 1, 2);
- this.tableLayoutPanel1.Location = new System.Drawing.Point(19, 29);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 6;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.Size = new System.Drawing.Size(369, 182);
- this.tableLayoutPanel1.TabIndex = 62;
- //
- // Filters
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.label68);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "Filters";
- this.Size = new System.Drawing.Size(592, 270);
- ((System.ComponentModel.ISupportInitialize)(this.slider_deblock)).EndInit();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TextBox text_customDT;
- private System.Windows.Forms.Label label18;
- internal System.Windows.Forms.ComboBox drop_detelecine;
- private System.Windows.Forms.TextBox text_customDC;
- internal System.Windows.Forms.Label label1;
- internal System.Windows.Forms.ComboBox drop_decomb;
- private System.Windows.Forms.TextBox text_customDI;
- internal System.Windows.Forms.Label label2;
- internal System.Windows.Forms.ComboBox drop_deinterlace;
- private System.Windows.Forms.TextBox text_customDN;
- internal System.Windows.Forms.Label label3;
- internal System.Windows.Forms.ComboBox drop_denoise;
- internal System.Windows.Forms.TrackBar slider_deblock;
- internal System.Windows.Forms.CheckBox check_grayscale;
- internal System.Windows.Forms.Label label8;
- internal System.Windows.Forms.Label lbl_deblockVal;
- internal System.Windows.Forms.Label label68;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- }
-}
diff --git a/win/CS/Controls/Filters.cs b/win/CS/Controls/Filters.cs
deleted file mode 100644
index 32d7d7b3e..000000000
--- a/win/CS/Controls/Filters.cs
+++ /dev/null
@@ -1,469 +0,0 @@
-/* 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. */
-
-namespace Handbrake.Controls
-{
- using System;
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices.Functions;
- using HandBrake.ApplicationServices.Model.Encoding;
- using HandBrake.Interop.Model.Encoding;
-
- /// <summary>
- /// The Filters Panel
- /// </summary>
- public partial class Filters : UserControl
- {
- /// <summary>
- /// The Filter settings have changed
- /// </summary>
- public event EventHandler FilterSettingsChanged;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="Filters"/> class.
- /// Creates a new instance of Filters
- /// </summary>
- public Filters()
- {
- InitializeComponent();
- drop_decomb.SelectedIndex = 0;
- drop_deinterlace.SelectedIndex = 0;
- drop_denoise.SelectedIndex = 0;
- drop_detelecine.SelectedIndex = 0;
- }
-
- #region Properties
-
- /// <summary>
- /// Gets Decomb.
- /// </summary>
- public Decomb Decomb
- {
- get
- {
- return EnumHelper<Decomb>.GetValue(drop_decomb.Text);
- }
- }
-
- /// <summary>
- /// Gets CustomDecombValue.
- /// </summary>
- public string CustomDecombValue
- {
- get
- {
- return text_customDC.Text;
- }
- }
-
- /// <summary>
- /// Gets Deinterlace.
- /// </summary>
- public Deinterlace Deinterlace
- {
- get
- {
- return EnumHelper<Deinterlace>.GetValue(drop_deinterlace.Text);
- }
- }
-
- /// <summary>
- /// Gets CustomDeInterlaceValue.
- /// </summary>
- public string CustomDeInterlaceValue
- {
- get
- {
- return text_customDI.Text;
- }
- }
-
- /// <summary>
- /// Gets Detelecine.
- /// </summary>
- public Detelecine Detelecine
- {
- get
- {
- return EnumHelper<Detelecine>.GetValue(drop_detelecine.Text);
- }
- }
-
- /// <summary>
- /// Gets CustomDeTelecineValue.
- /// </summary>
- public string CustomDeTelecineValue
- {
- get
- {
- return text_customDT.Text;
- }
- }
-
- /// <summary>
- /// Gets Denoise.
- /// </summary>
- public Denoise Denoise
- {
- get
- {
- return EnumHelper<Denoise>.GetValue(drop_denoise.Text);
- }
- }
-
- /// <summary>
- /// Gets CustomDenoiseValue.
- /// </summary>
- public string CustomDenoiseValue
- {
- get
- {
- return text_customDN.Text;
- }
- }
-
- /// <summary>
- /// Gets Deblock.
- /// </summary>
- public int Deblock
- {
- get
- {
- return this.slider_deblock.Value != 4 ? this.slider_deblock.Value : 0;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether GrayScale.
- /// </summary>
- public bool GrayScale
- {
- get
- {
- return check_grayscale.Checked;
- }
- }
-
- #endregion
-
- /// <summary>
- /// Gets the CLI query for the query generator.
- /// </summary>
- public string GetCliQuery
- {
- get
- {
- string query = string.Empty;
-
- switch (drop_detelecine.Text) // DeTelecine
- {
- case "Off":
- query += string.Empty;
- break;
- case "Default":
- query += " --detelecine";
- break;
- case "Custom":
- query += " --detelecine=\"" + text_customDT.Text + "\"";
- break;
- default:
- query += string.Empty;
- break;
- }
-
- switch (drop_decomb.Text) // Decomb
- {
- case "Off":
- query += string.Empty;
- break;
- case "Default":
- query += " --decomb";
- break;
- case "Custom":
- query += " --decomb=\"" + text_customDC.Text + "\"";
- break;
- case "Fast":
- query += " --decomb=\"7:2:6:9:1:80\"";
- break;
- case "Bob":
- query += " --decomb=\"bob\"";
- break;
- default:
- query += string.Empty;
- break;
- }
-
- switch (drop_deinterlace.Text) // DeInterlace
- {
- case "None":
- query += string.Empty;
- break;
- case "Fast":
- query += " --deinterlace=\"fast\"";
- break;
- case "Slow":
- query += " --deinterlace=\"slow\"";
- break;
- case "Slower":
- query += " --deinterlace=\"slower\"";
- break;
- case "Custom":
- query += " --deinterlace=\"" + text_customDI.Text + "\"";
- break;
- case "Bob":
- query += " --deinterlace=\"bob\"";
- break;
- default:
- query += string.Empty;
- break;
- }
-
- switch (drop_denoise.Text) // Denoise
- {
- case "None":
- query += string.Empty;
- break;
- case "Weak":
- query += " --denoise=\"weak\"";
- break;
- case "Medium":
- query += " --denoise=\"medium\"";
- break;
- case "Strong":
- query += " --denoise=\"strong\"";
- break;
- case "Custom":
- query += " --denoise=\"" + text_customDN.Text + "\"";
- break;
- default:
- query += string.Empty;
- break;
- }
-
- if (slider_deblock.Value != 4)
- query += " --deblock=" + slider_deblock.Value;
-
- if (check_grayscale.Checked)
- query += " -g ";
-
- return query;
- }
- }
-
- /// <summary>
- /// Set the Detelecine control
- /// </summary>
- /// <param name="value">
- /// The value part of the CLI string
- /// </param>
- /// <param name="custom">
- /// The Custom Detelecine setting
- /// </param>
- public void SetDeTelecine(Detelecine value, string custom)
- {
- text_customDT.Text = string.Empty;
- text_customDT.Visible = false;
- switch (value)
- {
- case Detelecine.Off:
- drop_detelecine.SelectedIndex = 0;
- break;
- case Detelecine.Default:
- drop_detelecine.SelectedIndex = 2;
- break;
- default:
- drop_detelecine.SelectedIndex = 1;
- text_customDT.Text = custom;
- text_customDT.Visible = true;
- break;
- }
- }
-
- /// <summary>
- /// Set the Denoise control
- /// </summary>
- /// <param name="value">
- /// The value part of the CLI string
- /// </param>
- /// <param name="custom">
- /// The custom denoise setting.
- /// </param>
- public void SetDeNoise(Denoise value, string custom)
- {
- text_customDN.Text = string.Empty;
- text_customDN.Visible = false;
- switch (value)
- {
- case Denoise.Off:
- drop_denoise.SelectedIndex = 0;
- break;
- case Denoise.Weak:
- drop_denoise.SelectedIndex = 2;
- break;
- case Denoise.Medium:
- drop_denoise.SelectedIndex = 3;
- break;
- case Denoise.Strong:
- drop_denoise.SelectedIndex = 4;
- break;
- default:
- drop_denoise.SelectedIndex = 1;
- text_customDN.Text = custom;
- text_customDN.Visible = true;
- break;
- }
- }
-
- /// <summary>
- /// Set the Deinterlace Control
- /// </summary>
- /// <param name="value">
- /// The value part of the CLI string
- /// </param>
- /// <param name="custom">
- /// The Custom Detinerlace Settings
- /// </param>
- public void SetDeInterlace(Deinterlace value, string custom)
- {
- text_customDI.Text = string.Empty;
- text_customDI.Visible = false;
- switch (value)
- {
- case Deinterlace.Off:
- drop_deinterlace.SelectedIndex = 0;
- break;
- case Deinterlace.Fast:
- drop_deinterlace.SelectedIndex = 2;
- break;
- case Deinterlace.Slow:
- drop_deinterlace.SelectedIndex = 3;
- break;
- case Deinterlace.Slower:
- drop_deinterlace.SelectedIndex = 4;
- break;
- case Deinterlace.Bob:
- drop_deinterlace.SelectedIndex = 5;
- break;
- default:
- drop_deinterlace.SelectedIndex = 1;
- text_customDI.Text = custom;
- text_customDI.Visible = true;
- break;
- }
- }
-
- /// <summary>
- /// Set the Decomb Control
- /// </summary>
- /// <param name="value">
- /// The value part of the CLI string
- /// </param>
- /// <param name="custom">
- /// The custom option string
- /// </param>
- public void SetDecomb(Decomb value, string custom)
- {
- text_customDC.Text = string.Empty;
- text_customDC.Visible = false;
- switch (value)
- {
- case Decomb.Off:
- drop_decomb.SelectedIndex = 0;
- break;
- case Decomb.Default:
- drop_decomb.SelectedIndex = 2;
- break;
- case Decomb.Fast:
- drop_decomb.SelectedIndex = 3;
- break;
- case Decomb.Bob:
- drop_decomb.SelectedIndex = 4;
- break;
- default:
- drop_decomb.SelectedIndex = 1;
- text_customDC.Text = custom;
- text_customDC.Visible = true;
- break;
- }
- }
-
- /// <summary>
- /// Set the Deblock Control
- /// </summary>
- /// <param name="value">The deblock value</param>
- public void SetDeBlock(int value)
- {
- if (value != 0)
- {
- slider_deblock.Value = value;
- lbl_deblockVal.Text = value.ToString();
- }
- else
- {
- slider_deblock.Value = 4;
- lbl_deblockVal.Text = "Off";
- }
- }
-
- /// <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 DropDetelecineSelectedIndexChanged(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 DropDecombSelectedIndexChanged(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 DropDeinterlaceSelectedIndexChanged(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 DropDenoiseSelectedIndexChanged(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 SliderDeblockScroll(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());
- }
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/Filters.resx b/win/CS/Controls/Filters.resx
deleted file mode 100644
index c7e0d4bdf..000000000
--- a/win/CS/Controls/Filters.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/win/CS/Controls/PictureSettings.Designer.cs b/win/CS/Controls/PictureSettings.Designer.cs
deleted file mode 100644
index 2dfbd9735..000000000
--- a/win/CS/Controls/PictureSettings.Designer.cs
+++ /dev/null
@@ -1,688 +0,0 @@
-namespace Handbrake.Controls
-{
- partial class PictureSettings
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
- this.Label15 = new System.Windows.Forms.Label();
- this.crop_left = new System.Windows.Forms.NumericUpDown();
- this.crop_right = new System.Windows.Forms.NumericUpDown();
- this.check_autoCrop = new System.Windows.Forms.RadioButton();
- this.Label51 = new System.Windows.Forms.Label();
- this.crop_top = new System.Windows.Forms.NumericUpDown();
- this.Label53 = new System.Windows.Forms.Label();
- this.Label52 = new System.Windows.Forms.Label();
- this.crop_bottom = new System.Windows.Forms.NumericUpDown();
- this.check_customCrop = new System.Windows.Forms.RadioButton();
- this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
- this.label7 = new System.Windows.Forms.Label();
- this.lbl_src_res = new System.Windows.Forms.Label();
- this.Label55 = new System.Windows.Forms.Label();
- this.text_width = new System.Windows.Forms.NumericUpDown();
- this.label4 = new System.Windows.Forms.Label();
- this.text_height = new System.Windows.Forms.NumericUpDown();
- this.check_KeepAR = new System.Windows.Forms.CheckBox();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.updownParHeight = new System.Windows.Forms.NumericUpDown();
- this.label6 = new System.Windows.Forms.Label();
- this.labelDisplaySize = new System.Windows.Forms.Label();
- this.lbl_parHeight = new System.Windows.Forms.Label();
- this.labelStaticDisplaySize = new System.Windows.Forms.Label();
- this.updownParWidth = new System.Windows.Forms.NumericUpDown();
- this.drp_anamorphic = new System.Windows.Forms.ComboBox();
- this.lbl_parWidth = new System.Windows.Forms.Label();
- this.updownDisplayWidth = new System.Windows.Forms.NumericUpDown();
- this.lbl_modulus = new System.Windows.Forms.Label();
- this.lbl_displayWidth = new System.Windows.Forms.Label();
- this.drp_modulus = new System.Windows.Forms.ComboBox();
- this.label8 = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
- this.lbl_presetCropWarning = new System.Windows.Forms.Label();
- this.tableLayoutPanel3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.crop_left)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_right)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_top)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).BeginInit();
- this.tableLayoutPanel2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.text_width)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.text_height)).BeginInit();
- this.tableLayoutPanel1.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.updownParHeight)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.updownParWidth)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.updownDisplayWidth)).BeginInit();
- this.SuspendLayout();
- //
- // tableLayoutPanel3
- //
- this.tableLayoutPanel3.AutoSize = true;
- this.tableLayoutPanel3.ColumnCount = 5;
- this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel3.Controls.Add(this.Label15, 0, 4);
- this.tableLayoutPanel3.Controls.Add(this.crop_left, 1, 4);
- this.tableLayoutPanel3.Controls.Add(this.crop_right, 3, 4);
- this.tableLayoutPanel3.Controls.Add(this.check_autoCrop, 0, 0);
- this.tableLayoutPanel3.Controls.Add(this.Label51, 4, 4);
- this.tableLayoutPanel3.Controls.Add(this.crop_top, 2, 3);
- this.tableLayoutPanel3.Controls.Add(this.Label53, 2, 6);
- this.tableLayoutPanel3.Controls.Add(this.Label52, 2, 2);
- this.tableLayoutPanel3.Controls.Add(this.crop_bottom, 2, 5);
- this.tableLayoutPanel3.Controls.Add(this.check_customCrop, 0, 1);
- this.tableLayoutPanel3.Location = new System.Drawing.Point(419, 35);
- this.tableLayoutPanel3.Name = "tableLayoutPanel3";
- this.tableLayoutPanel3.RowCount = 7;
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel3.Size = new System.Drawing.Size(217, 165);
- this.tableLayoutPanel3.TabIndex = 117;
- //
- // Label15
- //
- this.Label15.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.Label15.AutoSize = true;
- this.Label15.BackColor = System.Drawing.Color.Transparent;
- this.Label15.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.Label15.Location = new System.Drawing.Point(0, 99);
- this.Label15.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.Label15.Name = "Label15";
- this.Label15.Size = new System.Drawing.Size(26, 13);
- this.Label15.TabIndex = 97;
- this.Label15.Text = "Left";
- //
- // crop_left
- //
- this.crop_left.Enabled = false;
- this.crop_left.Increment = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.crop_left.Location = new System.Drawing.Point(32, 95);
- this.crop_left.Maximum = new decimal(new int[] {
- 128000,
- 0,
- 0,
- 0});
- this.crop_left.Name = "crop_left";
- this.crop_left.Size = new System.Drawing.Size(44, 21);
- this.crop_left.TabIndex = 98;
- this.crop_left.ValueChanged += new System.EventHandler(this.CropValueChanged);
- //
- // crop_right
- //
- this.crop_right.Enabled = false;
- this.crop_right.Increment = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.crop_right.Location = new System.Drawing.Point(132, 95);
- this.crop_right.Maximum = new decimal(new int[] {
- 128000,
- 0,
- 0,
- 0});
- this.crop_right.Name = "crop_right";
- this.crop_right.Size = new System.Drawing.Size(44, 21);
- this.crop_right.TabIndex = 101;
- this.crop_right.ValueChanged += new System.EventHandler(this.CropValueChanged);
- //
- // check_autoCrop
- //
- this.check_autoCrop.AutoSize = true;
- this.check_autoCrop.Checked = true;
- this.tableLayoutPanel3.SetColumnSpan(this.check_autoCrop, 5);
- this.check_autoCrop.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.check_autoCrop.Location = new System.Drawing.Point(0, 3);
- this.check_autoCrop.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.check_autoCrop.Name = "check_autoCrop";
- this.check_autoCrop.Size = new System.Drawing.Size(73, 17);
- this.check_autoCrop.TabIndex = 105;
- this.check_autoCrop.TabStop = true;
- this.check_autoCrop.Text = "Automatic";
- this.check_autoCrop.UseVisualStyleBackColor = true;
- this.check_autoCrop.CheckedChanged += new System.EventHandler(this.CheckAutoCropCheckedChanged);
- //
- // Label51
- //
- this.Label51.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.Label51.AutoSize = true;
- this.Label51.BackColor = System.Drawing.Color.Transparent;
- this.Label51.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.Label51.Location = new System.Drawing.Point(182, 99);
- this.Label51.Margin = new System.Windows.Forms.Padding(3);
- this.Label51.Name = "Label51";
- this.Label51.Size = new System.Drawing.Size(32, 13);
- this.Label51.TabIndex = 102;
- this.Label51.Text = "Right";
- //
- // crop_top
- //
- this.crop_top.Enabled = false;
- this.crop_top.Increment = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.crop_top.Location = new System.Drawing.Point(82, 68);
- this.crop_top.Maximum = new decimal(new int[] {
- 128000,
- 0,
- 0,
- 0});
- this.crop_top.Name = "crop_top";
- this.crop_top.Size = new System.Drawing.Size(44, 21);
- this.crop_top.TabIndex = 100;
- this.crop_top.ValueChanged += new System.EventHandler(this.CropValueChanged);
- //
- // Label53
- //
- this.Label53.Anchor = System.Windows.Forms.AnchorStyles.Top;
- this.Label53.AutoSize = true;
- this.Label53.BackColor = System.Drawing.Color.Transparent;
- this.Label53.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.Label53.Location = new System.Drawing.Point(83, 149);
- this.Label53.Margin = new System.Windows.Forms.Padding(3);
- this.Label53.Name = "Label53";
- this.Label53.Size = new System.Drawing.Size(41, 13);
- this.Label53.TabIndex = 104;
- this.Label53.Text = "Bottom";
- //
- // Label52
- //
- this.Label52.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
- this.Label52.AutoSize = true;
- this.Label52.BackColor = System.Drawing.Color.Transparent;
- this.Label52.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.Label52.Location = new System.Drawing.Point(91, 49);
- this.Label52.Margin = new System.Windows.Forms.Padding(3);
- this.Label52.Name = "Label52";
- this.Label52.Size = new System.Drawing.Size(25, 13);
- this.Label52.TabIndex = 99;
- this.Label52.Text = "Top";
- //
- // crop_bottom
- //
- this.crop_bottom.Enabled = false;
- this.crop_bottom.Increment = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.crop_bottom.Location = new System.Drawing.Point(82, 122);
- this.crop_bottom.Maximum = new decimal(new int[] {
- 128000,
- 0,
- 0,
- 0});
- this.crop_bottom.Name = "crop_bottom";
- this.crop_bottom.Size = new System.Drawing.Size(44, 21);
- this.crop_bottom.TabIndex = 103;
- this.crop_bottom.ValueChanged += new System.EventHandler(this.CropValueChanged);
- //
- // check_customCrop
- //
- this.check_customCrop.AutoSize = true;
- this.tableLayoutPanel3.SetColumnSpan(this.check_customCrop, 5);
- this.check_customCrop.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.check_customCrop.Location = new System.Drawing.Point(0, 26);
- this.check_customCrop.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.check_customCrop.Name = "check_customCrop";
- this.check_customCrop.Size = new System.Drawing.Size(61, 17);
- this.check_customCrop.TabIndex = 106;
- this.check_customCrop.Text = "Custom";
- this.check_customCrop.UseVisualStyleBackColor = true;
- //
- // tableLayoutPanel2
- //
- this.tableLayoutPanel2.AutoSize = true;
- this.tableLayoutPanel2.ColumnCount = 5;
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel2.Controls.Add(this.label7, 0, 0);
- this.tableLayoutPanel2.Controls.Add(this.lbl_src_res, 1, 0);
- this.tableLayoutPanel2.Controls.Add(this.Label55, 0, 1);
- this.tableLayoutPanel2.Controls.Add(this.text_width, 1, 1);
- this.tableLayoutPanel2.Controls.Add(this.label4, 2, 1);
- this.tableLayoutPanel2.Controls.Add(this.text_height, 3, 1);
- this.tableLayoutPanel2.Controls.Add(this.check_KeepAR, 1, 2);
- this.tableLayoutPanel2.Location = new System.Drawing.Point(16, 35);
- this.tableLayoutPanel2.Name = "tableLayoutPanel2";
- this.tableLayoutPanel2.RowCount = 3;
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel2.Size = new System.Drawing.Size(376, 69);
- this.tableLayoutPanel2.TabIndex = 116;
- //
- // label7
- //
- this.label7.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label7.AutoSize = true;
- this.label7.BackColor = System.Drawing.Color.Transparent;
- this.label7.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label7.Location = new System.Drawing.Point(0, 3);
- this.label7.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(44, 13);
- this.label7.TabIndex = 76;
- this.label7.Text = "Source:";
- //
- // lbl_src_res
- //
- this.lbl_src_res.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.lbl_src_res.AutoSize = true;
- this.lbl_src_res.BackColor = System.Drawing.Color.Transparent;
- this.lbl_src_res.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.lbl_src_res.Location = new System.Drawing.Point(50, 3);
- this.lbl_src_res.Margin = new System.Windows.Forms.Padding(3);
- this.lbl_src_res.Name = "lbl_src_res";
- this.lbl_src_res.Size = new System.Drawing.Size(15, 13);
- this.lbl_src_res.TabIndex = 77;
- this.lbl_src_res.Text = "--";
- //
- // Label55
- //
- this.Label55.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.Label55.AutoSize = true;
- this.Label55.BackColor = System.Drawing.Color.Transparent;
- this.Label55.ForeColor = System.Drawing.Color.Black;
- this.Label55.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.Label55.Location = new System.Drawing.Point(0, 26);
- this.Label55.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.Label55.Name = "Label55";
- this.Label55.Size = new System.Drawing.Size(39, 13);
- this.Label55.TabIndex = 80;
- this.Label55.Text = "Width:";
- //
- // text_width
- //
- this.text_width.Location = new System.Drawing.Point(50, 22);
- this.text_width.Maximum = new decimal(new int[] {
- 1280000,
- 0,
- 0,
- 0});
- this.text_width.Name = "text_width";
- this.text_width.Size = new System.Drawing.Size(64, 21);
- this.text_width.TabIndex = 85;
- this.text_width.ValueChanged += new System.EventHandler(this.TextWidthValueChanged);
- //
- // label4
- //
- this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label4.AutoSize = true;
- this.label4.BackColor = System.Drawing.Color.Transparent;
- this.label4.ForeColor = System.Drawing.Color.Black;
- this.label4.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label4.Location = new System.Drawing.Point(120, 26);
- this.label4.Margin = new System.Windows.Forms.Padding(3);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(42, 13);
- this.label4.TabIndex = 84;
- this.label4.Text = "Height:";
- //
- // text_height
- //
- this.text_height.Location = new System.Drawing.Point(168, 22);
- this.text_height.Maximum = new decimal(new int[] {
- 1280000,
- 0,
- 0,
- 0});
- this.text_height.Name = "text_height";
- this.text_height.Size = new System.Drawing.Size(64, 21);
- this.text_height.TabIndex = 86;
- this.text_height.ValueChanged += new System.EventHandler(this.TextHeightValueChanged);
- //
- // check_KeepAR
- //
- this.check_KeepAR.AutoSize = true;
- this.check_KeepAR.Checked = true;
- this.check_KeepAR.CheckState = System.Windows.Forms.CheckState.Checked;
- this.tableLayoutPanel2.SetColumnSpan(this.check_KeepAR, 3);
- this.check_KeepAR.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.check_KeepAR.Location = new System.Drawing.Point(50, 49);
- this.check_KeepAR.Name = "check_KeepAR";
- this.check_KeepAR.Size = new System.Drawing.Size(114, 17);
- this.check_KeepAR.TabIndex = 95;
- this.check_KeepAR.Text = "Keep Aspect Ratio";
- this.check_KeepAR.UseVisualStyleBackColor = true;
- this.check_KeepAR.CheckedChanged += new System.EventHandler(this.CheckKeepArCheckedChanged);
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.AutoSize = true;
- this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.tableLayoutPanel1.ColumnCount = 2;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
- this.tableLayoutPanel1.Controls.Add(this.updownParHeight, 1, 4);
- this.tableLayoutPanel1.Controls.Add(this.label6, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.labelDisplaySize, 1, 5);
- this.tableLayoutPanel1.Controls.Add(this.lbl_parHeight, 0, 4);
- this.tableLayoutPanel1.Controls.Add(this.labelStaticDisplaySize, 0, 5);
- this.tableLayoutPanel1.Controls.Add(this.updownParWidth, 1, 3);
- this.tableLayoutPanel1.Controls.Add(this.drp_anamorphic, 1, 0);
- this.tableLayoutPanel1.Controls.Add(this.lbl_parWidth, 0, 3);
- this.tableLayoutPanel1.Controls.Add(this.updownDisplayWidth, 1, 2);
- this.tableLayoutPanel1.Controls.Add(this.lbl_modulus, 0, 1);
- this.tableLayoutPanel1.Controls.Add(this.lbl_displayWidth, 0, 2);
- this.tableLayoutPanel1.Controls.Add(this.drp_modulus, 1, 1);
- this.tableLayoutPanel1.Location = new System.Drawing.Point(16, 110);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 6;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.Size = new System.Drawing.Size(195, 154);
- this.tableLayoutPanel1.TabIndex = 115;
- //
- // updownParHeight
- //
- this.updownParHeight.Location = new System.Drawing.Point(82, 111);
- this.updownParHeight.Maximum = new decimal(new int[] {
- 1280000,
- 0,
- 0,
- 0});
- this.updownParHeight.Name = "updownParHeight";
- this.updownParHeight.Size = new System.Drawing.Size(53, 21);
- this.updownParHeight.TabIndex = 112;
- this.updownParHeight.ValueChanged += new System.EventHandler(this.TextWidthValueChanged);
- //
- // label6
- //
- this.label6.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.label6.AutoSize = true;
- this.label6.BackColor = System.Drawing.Color.Transparent;
- this.label6.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label6.Location = new System.Drawing.Point(0, 7);
- this.label6.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(67, 13);
- this.label6.TabIndex = 81;
- this.label6.Text = "Anamorphic:";
- //
- // labelDisplaySize
- //
- this.labelDisplaySize.AutoSize = true;
- this.labelDisplaySize.BackColor = System.Drawing.Color.Transparent;
- this.labelDisplaySize.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.labelDisplaySize.Location = new System.Drawing.Point(82, 138);
- this.labelDisplaySize.Margin = new System.Windows.Forms.Padding(3);
- this.labelDisplaySize.Name = "labelDisplaySize";
- this.labelDisplaySize.Size = new System.Drawing.Size(15, 13);
- this.labelDisplaySize.TabIndex = 108;
- this.labelDisplaySize.Text = "--";
- //
- // lbl_parHeight
- //
- this.lbl_parHeight.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.lbl_parHeight.AutoSize = true;
- this.lbl_parHeight.BackColor = System.Drawing.Color.Transparent;
- this.lbl_parHeight.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.lbl_parHeight.Location = new System.Drawing.Point(0, 115);
- this.lbl_parHeight.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.lbl_parHeight.Name = "lbl_parHeight";
- this.lbl_parHeight.Size = new System.Drawing.Size(65, 13);
- this.lbl_parHeight.TabIndex = 94;
- this.lbl_parHeight.Text = "PAR Height:";
- //
- // labelStaticDisplaySize
- //
- this.labelStaticDisplaySize.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.labelStaticDisplaySize.AutoSize = true;
- this.labelStaticDisplaySize.BackColor = System.Drawing.Color.Transparent;
- this.labelStaticDisplaySize.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.labelStaticDisplaySize.Location = new System.Drawing.Point(0, 138);
- this.labelStaticDisplaySize.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.labelStaticDisplaySize.Name = "labelStaticDisplaySize";
- this.labelStaticDisplaySize.Size = new System.Drawing.Size(67, 13);
- this.labelStaticDisplaySize.TabIndex = 107;
- this.labelStaticDisplaySize.Text = "Display Size:";
- //
- // updownParWidth
- //
- this.updownParWidth.Location = new System.Drawing.Point(82, 84);
- this.updownParWidth.Maximum = new decimal(new int[] {
- 1280000,
- 0,
- 0,
- 0});
- this.updownParWidth.Name = "updownParWidth";
- this.updownParWidth.Size = new System.Drawing.Size(53, 21);
- this.updownParWidth.TabIndex = 111;
- this.updownParWidth.ValueChanged += new System.EventHandler(this.TextWidthValueChanged);
- //
- // drp_anamorphic
- //
- this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_anamorphic.FormattingEnabled = true;
- this.drp_anamorphic.Items.AddRange(new object[] {
- "None",
- "Strict",
- "Loose",
- "Custom"});
- this.drp_anamorphic.Location = new System.Drawing.Point(82, 3);
- this.drp_anamorphic.Name = "drp_anamorphic";
- this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);
- this.drp_anamorphic.TabIndex = 82;
- this.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.DrpAnamorphicSelectedIndexChanged);
- //
- // lbl_parWidth
- //
- this.lbl_parWidth.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.lbl_parWidth.AutoSize = true;
- this.lbl_parWidth.BackColor = System.Drawing.Color.Transparent;
- this.lbl_parWidth.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.lbl_parWidth.Location = new System.Drawing.Point(0, 88);
- this.lbl_parWidth.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.lbl_parWidth.Name = "lbl_parWidth";
- this.lbl_parWidth.Size = new System.Drawing.Size(62, 13);
- this.lbl_parWidth.TabIndex = 92;
- this.lbl_parWidth.Text = "PAR Width:";
- //
- // updownDisplayWidth
- //
- this.updownDisplayWidth.Location = new System.Drawing.Point(82, 57);
- this.updownDisplayWidth.Maximum = new decimal(new int[] {
- 1280000,
- 0,
- 0,
- 0});
- this.updownDisplayWidth.Name = "updownDisplayWidth";
- this.updownDisplayWidth.Size = new System.Drawing.Size(53, 21);
- this.updownDisplayWidth.TabIndex = 110;
- this.updownDisplayWidth.ValueChanged += new System.EventHandler(this.UpdownDisplayWidthValueChanged);
- //
- // lbl_modulus
- //
- this.lbl_modulus.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.lbl_modulus.AutoSize = true;
- this.lbl_modulus.BackColor = System.Drawing.Color.Transparent;
- this.lbl_modulus.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.lbl_modulus.Location = new System.Drawing.Point(0, 34);
- this.lbl_modulus.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.lbl_modulus.Name = "lbl_modulus";
- this.lbl_modulus.Size = new System.Drawing.Size(50, 13);
- this.lbl_modulus.TabIndex = 87;
- this.lbl_modulus.Text = "Modulus:";
- //
- // lbl_displayWidth
- //
- this.lbl_displayWidth.Anchor = System.Windows.Forms.AnchorStyles.Left;
- this.lbl_displayWidth.AutoSize = true;
- this.lbl_displayWidth.BackColor = System.Drawing.Color.Transparent;
- this.lbl_displayWidth.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.lbl_displayWidth.Location = new System.Drawing.Point(0, 61);
- this.lbl_displayWidth.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
- this.lbl_displayWidth.Name = "lbl_displayWidth";
- this.lbl_displayWidth.Size = new System.Drawing.Size(76, 13);
- this.lbl_displayWidth.TabIndex = 90;
- this.lbl_displayWidth.Text = "Display Width:";
- //
- // drp_modulus
- //
- this.drp_modulus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_modulus.FormattingEnabled = true;
- this.drp_modulus.Items.AddRange(new object[] {
- "16",
- "8",
- "4",
- "2"});
- this.drp_modulus.Location = new System.Drawing.Point(82, 30);
- this.drp_modulus.Name = "drp_modulus";
- this.drp_modulus.Size = new System.Drawing.Size(110, 21);
- this.drp_modulus.TabIndex = 88;
- this.drp_modulus.SelectedIndexChanged += new System.EventHandler(this.DrpModulusSelectedIndexChanged);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.BackColor = System.Drawing.Color.Transparent;
- this.label8.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label8.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label8.Location = new System.Drawing.Point(416, 13);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(57, 13);
- this.label8.TabIndex = 114;
- this.label8.Text = "Cropping";
- //
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.BackColor = System.Drawing.Color.Transparent;
- this.label26.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label26.ImeMode = System.Windows.Forms.ImeMode.NoControl;
- this.label26.Location = new System.Drawing.Point(13, 13);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(30, 13);
- this.label26.TabIndex = 113;
- this.label26.Text = "Size";
- //
- // lbl_presetCropWarning
- //
- this.lbl_presetCropWarning.AutoSize = true;
- this.lbl_presetCropWarning.ForeColor = System.Drawing.Color.Black;
- this.lbl_presetCropWarning.Location = new System.Drawing.Point(479, 13);
- this.lbl_presetCropWarning.Name = "lbl_presetCropWarning";
- this.lbl_presetCropWarning.Size = new System.Drawing.Size(140, 13);
- this.lbl_presetCropWarning.TabIndex = 118;
- this.lbl_presetCropWarning.Text = "( Preset values are in use! )";
- //
- // PictureSettings
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.lbl_presetCropWarning);
- this.Controls.Add(this.tableLayoutPanel3);
- this.Controls.Add(this.tableLayoutPanel2);
- this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.label8);
- this.Controls.Add(this.label26);
- this.Enabled = false;
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "PictureSettings";
- this.Size = new System.Drawing.Size(666, 279);
- this.tableLayoutPanel3.ResumeLayout(false);
- this.tableLayoutPanel3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.crop_left)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_right)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_top)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).EndInit();
- this.tableLayoutPanel2.ResumeLayout(false);
- this.tableLayoutPanel2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.text_width)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.text_height)).EndInit();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.updownParHeight)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.updownParWidth)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.updownDisplayWidth)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
- internal System.Windows.Forms.Label Label15;
- internal System.Windows.Forms.NumericUpDown crop_left;
- internal System.Windows.Forms.NumericUpDown crop_right;
- internal System.Windows.Forms.RadioButton check_autoCrop;
- internal System.Windows.Forms.Label Label51;
- internal System.Windows.Forms.NumericUpDown crop_top;
- internal System.Windows.Forms.Label Label53;
- internal System.Windows.Forms.Label Label52;
- internal System.Windows.Forms.NumericUpDown crop_bottom;
- internal System.Windows.Forms.RadioButton check_customCrop;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
- internal System.Windows.Forms.Label label7;
- internal System.Windows.Forms.Label lbl_src_res;
- internal System.Windows.Forms.Label Label55;
- internal System.Windows.Forms.Label label4;
- internal System.Windows.Forms.CheckBox check_KeepAR;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- internal System.Windows.Forms.NumericUpDown updownParHeight;
- internal System.Windows.Forms.Label label6;
- internal System.Windows.Forms.Label labelDisplaySize;
- internal System.Windows.Forms.Label lbl_parHeight;
- internal System.Windows.Forms.Label labelStaticDisplaySize;
- internal System.Windows.Forms.NumericUpDown updownParWidth;
- internal System.Windows.Forms.ComboBox drp_anamorphic;
- internal System.Windows.Forms.Label lbl_parWidth;
- internal System.Windows.Forms.NumericUpDown updownDisplayWidth;
- internal System.Windows.Forms.Label lbl_modulus;
- internal System.Windows.Forms.Label lbl_displayWidth;
- internal System.Windows.Forms.ComboBox drp_modulus;
- internal System.Windows.Forms.Label label8;
- internal System.Windows.Forms.Label label26;
- internal System.Windows.Forms.NumericUpDown text_width;
- internal System.Windows.Forms.NumericUpDown text_height;
- private System.Windows.Forms.Label lbl_presetCropWarning;
-
-
-
- }
-}
diff --git a/win/CS/Controls/PictureSettings.cs b/win/CS/Controls/PictureSettings.cs
deleted file mode 100644
index 8e45b9778..000000000
--- a/win/CS/Controls/PictureSettings.cs
+++ /dev/null
@@ -1,572 +0,0 @@
-/* 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. */
-
-namespace Handbrake.Controls
-{
- using System;
- using System.Drawing;
- using System.Globalization;
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Utilities;
-
- /// <summary>
- /// The Picture Settings Panel
- /// </summary>
- public partial class PictureSettings : UserControl
- {
- private readonly CultureInfo culture = new CultureInfo("en-US", false);
- private bool preventChangingWidth;
- private bool preventChangingHeight;
- private bool preventChangingCustom;
- private bool preventChangingDisplayWidth;
- private double cachedDar;
- private Title sourceTitle;
- private Size presetMaximumResolution;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="PictureSettings"/> class.
- /// Creates a new instance of the Picture Settings Class
- /// </summary>
- public PictureSettings()
- {
- InitializeComponent();
-
- drp_anamorphic.SelectedIndex = 1;
- drp_modulus.SelectedIndex = 0;
- }
-
- /// <summary>
- /// Picture Settings Changed Event Handler
- /// </summary>
- public event EventHandler PictureSettingsChanged;
-
- /// <summary>
- /// Gets or sets the source media used by this control.
- /// </summary>
- public Title Source
- {
- private get
- {
- return sourceTitle;
- }
-
- set
- {
- sourceTitle = value;
- Enabled = sourceTitle != null;
- NewSourceSet();
- }
- }
-
- /// <summary>
- /// Gets or sets the currently selected preset.
- /// </summary>
- public Preset CurrentlySelectedPreset { get; set; }
-
- public bool SizeSet { get; set; }
-
- /// <summary>
- /// Gets or sets the maximum allowable size for the encoded resolution. Set a value to
- /// "0" if the maximum does not matter.
- /// </summary>
- public Size PresetMaximumResolution
- {
- get
- {
- return this.presetMaximumResolution;
- }
- set
- {
- this.presetMaximumResolution = value;
- if (presetMaximumResolution == new Size(0, 0) && !SizeSet && this.sourceTitle != null)
- {
- text_width.Value = this.sourceTitle.Resolution.Width;
- }
- }
- }
-
- /// <summary>
- /// Set the Preset Crop Warning Label
- /// </summary>
- /// <param name="selectedPreset">
- /// The Selected preset
- /// </param>
- public void SetPresetCropWarningLabel(Preset selectedPreset)
- {
- if (this.check_customCrop.Checked)
- {
- lbl_presetCropWarning.Visible = true;
- if (selectedPreset != null && selectedPreset.CropSettings == false) lbl_presetCropWarning.Visible = false;
- else if (selectedPreset == null) lbl_presetCropWarning.Visible = false;
- }
- else
- {
- lbl_presetCropWarning.Visible = false;
- }
- }
-
- /// <summary>
- /// Setup the UI. The Source has just changed.
- /// </summary>
- private void NewSourceSet()
- {
- // Set the Aspect Ratio
- lbl_src_res.Text = sourceTitle.Resolution.Width + " x " + sourceTitle.Resolution.Height;
-
- // Set the Recommended Cropping values, but only if a preset doesn't have hard set picture settings.
- EncodeTask presetQuery = null;
- if (this.CurrentlySelectedPreset != null)
- presetQuery = QueryParserUtility.Parse(CurrentlySelectedPreset.Query);
-
- if ((CurrentlySelectedPreset != null && CurrentlySelectedPreset.CropSettings == false) ||
- CurrentlySelectedPreset == null ||
- (presetQuery != null && !presetQuery.HasCropping)
- )
- {
- crop_top.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Top);
- crop_bottom.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Bottom);
- crop_left.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Left);
- crop_right.Value = GetCropMod2Clean(sourceTitle.AutoCropDimensions.Right);
- }
-
- SetPresetCropWarningLabel(CurrentlySelectedPreset);
-
- // Set the Resolution Boxes
- if (drp_anamorphic.SelectedIndex == 0)
- {
- int width = sourceTitle.Resolution.Width;
-
- if (width > PresetMaximumResolution.Width && PresetMaximumResolution.Width != 0) // If the preset has a Max width set, don't use a width larger than it.
- width = PresetMaximumResolution.Width;
-
- if (text_width.Value == 0 || (text_width.Value > PresetMaximumResolution.Width && PresetMaximumResolution.Width != 0)) // Only update the values if the fields don't already have values.
- text_width.Value = width;
-
- check_KeepAR.Checked = true; // Forces Resolution to be correct.
- }
- else
- {
- int width = sourceTitle.Resolution.Width;
- if (width > PresetMaximumResolution.Width && PresetMaximumResolution.Width != 0) // If the preset has a Max width set, don't use a width larger than it.
- width = PresetMaximumResolution.Width;
-
- int height = sourceTitle.Resolution.Height;
- if (height > PresetMaximumResolution.Height && PresetMaximumResolution.Height != 0) // If the preset has a Max height set, don't use a width larger than it.
- height = PresetMaximumResolution.Height;
-
- text_width.Value = width;
- text_height.Value = height - (int)crop_top.Value - (int)crop_bottom.Value;
-
- labelDisplaySize.Text = CalculateAnamorphicSizes().Width + "x" + CalculateAnamorphicSizes().Height;
- }
-
- updownParWidth.Value = sourceTitle.ParVal.Width;
- updownParHeight.Value = sourceTitle.ParVal.Height;
-
- Size croppedDar = CalculateAnamorphicSizes();
- cachedDar = (double)croppedDar.Width / croppedDar.Height;
- updownDisplayWidth.Value = croppedDar.Width;
- }
-
- // Picture Controls
- private void TextWidthValueChanged(object sender, EventArgs e)
- {
- if (preventChangingWidth)
- return;
-
- // Make sure the new value doesn't exceed the maximum
- if (Source != null)
- if (text_width.Value > Source.Resolution.Width)
- text_width.Value = Source.Resolution.Width;
-
- switch (drp_anamorphic.SelectedIndex)
- {
- case 0:
- if (check_KeepAR.Checked && Source != null)
- {
- preventChangingHeight = true;
-
- int width = (int)text_width.Value;
-
- double crop_width = Source.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
- double crop_height = Source.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
-
- if (SourceAspect.Width == 0 && SourceAspect.Height == 0)
- break;
-
- double newHeight = ((double)width * Source.Resolution.Width * SourceAspect.Height * crop_height) /
- (Source.Resolution.Height * SourceAspect.Width * crop_width);
- text_height.Value = (decimal)GetModulusValue(newHeight);
-
- preventChangingHeight = false;
- }
- break;
- case 3:
- if (check_KeepAR.CheckState == CheckState.Unchecked && Source != null)
- {
- if (preventChangingCustom)
- break;
-
- preventChangingDisplayWidth = true;
- updownDisplayWidth.Value = text_width.Value * updownParWidth.Value / updownParHeight.Value;
- preventChangingDisplayWidth = false;
-
- labelDisplaySize.Text = Math.Truncate(updownDisplayWidth.Value) + "x" + text_height.Value;
- }
-
- if (check_KeepAR.CheckState == CheckState.Checked && Source != null)
- {
- updownParWidth.Value = updownDisplayWidth.Value;
- updownParHeight.Value = text_width.Value;
- }
- break;
- default:
- labelDisplaySize.Text = CalculateAnamorphicSizes().Width + "x" + CalculateAnamorphicSizes().Height;
- break;
- }
-
- preventChangingWidth = false;
- }
-
- private void TextHeightValueChanged(object sender, EventArgs e)
- {
- if (preventChangingHeight)
- return;
-
- if (Source != null)
- if (text_height.Value > Source.Resolution.Height)
- text_height.Value = Source.Resolution.Height;
-
- switch (drp_anamorphic.SelectedIndex)
- {
- case 0:
- if (check_KeepAR.Checked && Source != null)
- {
- preventChangingWidth = true;
-
- double crop_width = Source.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
- double crop_height = Source.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
-
- double new_width = ((double)text_height.Value * Source.Resolution.Height * SourceAspect.Width *
- crop_width) /
- (Source.Resolution.Width * SourceAspect.Height * crop_height);
-
- text_width.Value = (decimal)GetModulusValue(new_width);
-
- preventChangingWidth = false;
- }
- break;
- case 3:
- labelDisplaySize.Text = Math.Truncate(updownDisplayWidth.Value) + "x" + text_height.Value;
-
- if (check_KeepAR.CheckState == CheckState.Checked && Source != null)
- {
- // - Changes DISPLAY WIDTH to keep DAR
- // - Changes PIXEL WIDTH to new DISPLAY WIDTH
- // - Changes PIXEL HEIGHT to STORAGE WIDTH
- // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
-
- double rawCalculatedDisplayWidth = (double)text_height.Value * cachedDar;
-
- preventChangingDisplayWidth = true; // Start Guards
- preventChangingWidth = true;
-
- updownDisplayWidth.Value = (decimal)rawCalculatedDisplayWidth;
- updownParWidth.Value = updownDisplayWidth.Value;
- updownParHeight.Value = text_width.Value;
-
- preventChangingWidth = false; // Reset Guards
- preventChangingDisplayWidth = false;
- }
-
- break;
- default:
- labelDisplaySize.Text = CalculateAnamorphicSizes().Width + "x" + CalculateAnamorphicSizes().Height;
- break;
- }
-
- preventChangingHeight = false;
- }
-
- private void CheckKeepArCheckedChanged(object sender, EventArgs e)
- {
- // Force TextWidth to recalc height
- if (check_KeepAR.Checked)
- TextWidthValueChanged(this, new EventArgs());
-
- // Disable the Custom Anamorphic Par Controls if checked.
- if (drp_anamorphic.SelectedIndex == 3)
- {
- updownParWidth.Enabled = !check_KeepAR.Checked;
- updownParHeight.Enabled = !check_KeepAR.Checked;
- }
-
- // Raise the Picture Settings Changed Event
- if (PictureSettingsChanged != null)
- PictureSettingsChanged(this, new EventArgs());
- }
-
- private void UpdownDisplayWidthValueChanged(object sender, EventArgs e)
- {
- if (preventChangingDisplayWidth == false && check_KeepAR.CheckState == CheckState.Unchecked)
- {
- preventChangingCustom = true;
- updownParWidth.Value = updownDisplayWidth.Value;
- updownParHeight.Value = text_width.Value;
- preventChangingCustom = false;
- }
-
- if (preventChangingDisplayWidth == false && check_KeepAR.CheckState == CheckState.Checked)
- {
- // - Changes HEIGHT to keep DAR
- // - Changes PIXEL WIDTH to new DISPLAY WIDTH
- // - Changes PIXEL HEIGHT to STORAGE WIDTH
- // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
-
- // Calculate new Height Value
- int modulus;
- if (!int.TryParse(drp_modulus.SelectedItem.ToString(), out modulus))
- modulus = 16;
-
- int rawCalculatedHeight = (int)((int)updownDisplayWidth.Value / cachedDar);
- int modulusHeight = rawCalculatedHeight - (rawCalculatedHeight % modulus);
-
- // Update value
- preventChangingHeight = true;
- text_height.Value = (decimal)modulusHeight;
- updownParWidth.Value = updownDisplayWidth.Value;
- updownParHeight.Value = text_width.Value;
- preventChangingHeight = false;
- }
- }
-
- // Anamorphic Controls
- private void DrpAnamorphicSelectedIndexChanged(object sender, EventArgs e)
- {
- switch (drp_anamorphic.SelectedIndex)
- {
- case 0: // None
- text_width.Enabled = true;
- text_height.Enabled = true;
- check_KeepAR.Enabled = true;
-
- SetCustomAnamorphicOptionsVisible(false);
- labelStaticDisplaySize.Visible = false;
- labelDisplaySize.Visible = false;
- drp_modulus.Visible = true;
- lbl_modulus.Visible = true;
-
- // check_KeepAR.Checked = true;
-
- if (check_KeepAR.Checked)
- TextWidthValueChanged(this, new EventArgs());
- // Don't update display size if we're not using anamorphic
- return;
- case 1: // Strict
- text_width.Enabled = false;
- text_height.Enabled = false;
- check_KeepAR.Enabled = false;
-
- SetCustomAnamorphicOptionsVisible(false);
- labelStaticDisplaySize.Visible = true;
- labelDisplaySize.Visible = true;
-
- check_KeepAR.Checked = true;
- break;
- case 2: // Loose
- text_width.Enabled = true;
- text_height.Enabled = false;
- check_KeepAR.Enabled = false;
-
- SetCustomAnamorphicOptionsVisible(false);
- labelStaticDisplaySize.Visible = true;
- labelDisplaySize.Visible = true;
- drp_modulus.Visible = true;
- lbl_modulus.Visible = true;
-
- check_KeepAR.Checked = true;
- break;
- case 3: // Custom
- text_width.Enabled = true;
- text_height.Enabled = true;
- check_KeepAR.Enabled = true;
-
- SetCustomAnamorphicOptionsVisible(true);
- labelStaticDisplaySize.Visible = true;
- labelDisplaySize.Visible = true;
-
- check_KeepAR.Checked = true;
- updownParWidth.Enabled = !check_KeepAR.Checked;
- updownParHeight.Enabled = !check_KeepAR.Checked;
- break;
- }
-
- labelDisplaySize.Text = CalculateAnamorphicSizes().Width + "x" + CalculateAnamorphicSizes().Height;
-
- if (check_KeepAR.Checked)
- TextWidthValueChanged(this, new EventArgs());
-
- if (PictureSettingsChanged != null)
- PictureSettingsChanged(this, new EventArgs());
- }
-
- private void DrpModulusSelectedIndexChanged(object sender, EventArgs e)
- {
- preventChangingWidth = true;
- preventChangingHeight = true;
-
- text_width.Value = (decimal)GetModulusValue((double)text_width.Value);
- text_height.Value = (decimal)GetModulusValue((double)text_height.Value);
-
- preventChangingWidth = false;
- preventChangingHeight = false;
-
- text_width.Increment = int.Parse(drp_modulus.SelectedItem.ToString());
- text_height.Increment = int.Parse(drp_modulus.SelectedItem.ToString());
-
- if (PictureSettingsChanged != null)
- PictureSettingsChanged(this, new EventArgs());
- }
-
- // Cropping Controls
- private void CheckAutoCropCheckedChanged(object sender, EventArgs e)
- {
- crop_top.Enabled = check_customCrop.Checked;
- crop_bottom.Enabled = check_customCrop.Checked;
- crop_left.Enabled = check_customCrop.Checked;
- crop_right.Enabled = check_customCrop.Checked;
-
- if (Source != null)
- {
- crop_top.Value = Source.AutoCropDimensions.Top;
- crop_bottom.Value = Source.AutoCropDimensions.Bottom;
- crop_left.Value = Source.AutoCropDimensions.Left;
- crop_right.Value = Source.AutoCropDimensions.Right;
- }
- }
-
- private void CropValueChanged(object sender, EventArgs e)
- {
- TextWidthValueChanged(this, new EventArgs());
- }
-
- // GUI Functions
- private void SetCustomAnamorphicOptionsVisible(bool visible)
- {
- lbl_modulus.Visible = visible;
- lbl_displayWidth.Visible = visible;
- lbl_parWidth.Visible = visible;
- lbl_parHeight.Visible = visible;
-
- drp_modulus.Visible = visible;
- updownDisplayWidth.Visible = visible;
- updownParWidth.Visible = visible;
- updownParHeight.Visible = visible;
- }
-
- // Calculation Functions
- private Size SourceAspect
- {
- get
- {
- if (Source != null) // display aspect = (width * par_width) / (height * par_height)
- return new Size((Source.ParVal.Width * Source.Resolution.Width),
- (Source.ParVal.Height * Source.Resolution.Height));
-
- return new Size(0, 0); // Fall over to 16:9 and hope for the best
- }
- }
-
- private Size CalculateAnamorphicSizes()
- {
- if (Source != null)
- {
- /* Set up some variables to make the math easier to follow. */
- int croppedWidth = Source.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
- int croppedHeight = Source.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
- double storageAspect = (double)croppedWidth / croppedHeight;
-
- /* Figure out what width the source would display at. */
- double sourceDisplayWidth = (double)croppedWidth * Source.ParVal.Width / Source.ParVal.Height;
-
- /*
- 3 different ways of deciding output dimensions:
- - 1: Strict anamorphic, preserve source dimensions
- - 2: Loose anamorphic, round to mod16 and preserve storage aspect ratio
- - 3: Power user anamorphic, specify everything
- */
- double width, height;
- switch (drp_anamorphic.SelectedIndex)
- {
- default:
- case 1:
- /* Strict anamorphic */
- double displayWidth = ((double)croppedWidth * Source.ParVal.Width / Source.ParVal.Height);
- displayWidth = Math.Round(displayWidth, 0);
- Size output = new Size((int)displayWidth, croppedHeight);
- return output;
- case 2:
- /* "Loose" anamorphic.
- - Uses mod16-compliant dimensions,
- - Allows users to set the width
- */
- width = (int)text_width.Value;
- width = GetModulusValue(width); /* Time to get picture width that divide cleanly.*/
-
- height = (width / storageAspect) + 0.5;
- height = GetModulusValue(height); /* Time to get picture height that divide cleanly.*/
-
- /* The film AR is the source's display width / cropped source height.
- The output display width is the output height * film AR.
- The output PAR is the output display width / output storage width. */
- double pixelAspectWidth = height * sourceDisplayWidth / croppedHeight;
- double pixelAspectHeight = width;
-
- double disWidthLoose = (width * pixelAspectWidth / pixelAspectHeight);
- if (double.IsNaN(disWidthLoose))
- disWidthLoose = 0;
- return new Size((int)disWidthLoose, (int)height);
- case 3:
-
- // Get the User Interface Values
- double UIdisplayWidth;
- double.TryParse(updownDisplayWidth.Text, out UIdisplayWidth);
-
- /* Anamorphic 3: Power User Jamboree - Set everything based on specified values */
- height = GetModulusValue((double)text_height.Value);
-
- if (check_KeepAR.Checked)
- return new Size((int)Math.Truncate(UIdisplayWidth), (int)height);
-
- return new Size((int)Math.Truncate(UIdisplayWidth), (int)height);
- }
- }
-
- // Return a default value of 0,0 to indicate failure
- return new Size(0, 0);
- }
-
- private double GetModulusValue(double value)
- {
- int mod = int.Parse(drp_modulus.SelectedItem.ToString());
- double remainder = value % mod;
-
- if (remainder == 0)
- return value;
-
- return remainder >= ((double)mod / 2) ? value + (mod - remainder) : value - remainder;
- }
-
- private static int GetCropMod2Clean(int value)
- {
- int remainder = value % 2;
- if (remainder == 0) return value;
- return (value + remainder);
- }
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/PictureSettings.resx b/win/CS/Controls/PictureSettings.resx
deleted file mode 100644
index c7e0d4bdf..000000000
--- a/win/CS/Controls/PictureSettings.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/win/CS/Controls/Subtitles.Designer.cs b/win/CS/Controls/Subtitles.Designer.cs
deleted file mode 100644
index d4d08b700..000000000
--- a/win/CS/Controls/Subtitles.Designer.cs
+++ /dev/null
@@ -1,442 +0,0 @@
-namespace Handbrake.Controls
-{
- partial class Subtitles
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.lv_subList = new System.Windows.Forms.ListView();
- this.col_Source = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_forced = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_burned = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_defaultTrack = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_srtLang = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_srtChar = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.col_srtOffset = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.subMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnu_moveup = new System.Windows.Forms.ToolStripMenuItem();
- this.mnu_movedown = new System.Windows.Forms.ToolStripMenuItem();
- this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.mnu_remove = new System.Windows.Forms.ToolStripMenuItem();
- this.label68 = new System.Windows.Forms.Label();
- this.drp_subtitleTracks = new System.Windows.Forms.ComboBox();
- this.srt_offset = new System.Windows.Forms.NumericUpDown();
- this.srt_lang = new System.Windows.Forms.ComboBox();
- this.srt_charcode = new System.Windows.Forms.ComboBox();
- this.check_forced = new System.Windows.Forms.CheckBox();
- this.check_default = new System.Windows.Forms.CheckBox();
- this.check_burned = new System.Windows.Forms.CheckBox();
- this.btn_srtAdd = new System.Windows.Forms.Button();
- this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
- this.toolTip = new System.Windows.Forms.ToolTip(this.components);
- this.btn_addSubtitleTrack = new wyDay.Controls.SplitButton();
- this.SubtitleTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnu_AddAll = new System.Windows.Forms.ToolStripMenuItem();
- this.mnu_AddAllCC = new System.Windows.Forms.ToolStripMenuItem();
- this.SubtitleRemoveButtonMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();
- this.btn_RemoveTrack = new wyDay.Controls.SplitButton();
- this.subMenu.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.srt_offset)).BeginInit();
- this.SubtitleTrackMenu.SuspendLayout();
- this.SubtitleRemoveButtonMenu.SuspendLayout();
- this.SuspendLayout();
- //
- // lv_subList
- //
- this.lv_subList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.col_Source,
- this.col_forced,
- this.col_burned,
- this.col_defaultTrack,
- this.col_srtLang,
- this.col_srtChar,
- this.col_srtOffset});
- this.lv_subList.ContextMenuStrip = this.subMenu;
- this.lv_subList.FullRowSelect = true;
- this.lv_subList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
- this.lv_subList.HideSelection = false;
- this.lv_subList.LabelWrap = false;
- this.lv_subList.Location = new System.Drawing.Point(16, 96);
- this.lv_subList.MultiSelect = false;
- this.lv_subList.Name = "lv_subList";
- this.lv_subList.Size = new System.Drawing.Size(688, 186);
- this.lv_subList.TabIndex = 70;
- this.lv_subList.UseCompatibleStateImageBehavior = false;
- this.lv_subList.View = System.Windows.Forms.View.Details;
- this.lv_subList.SelectedIndexChanged += new System.EventHandler(this.LbSubListSelectedIndexChanged);
- //
- // col_Source
- //
- this.col_Source.Text = "Track";
- this.col_Source.Width = 160;
- //
- // col_forced
- //
- this.col_forced.Text = "Forced Only";
- this.col_forced.Width = 74;
- //
- // col_burned
- //
- this.col_burned.Text = "Burned In";
- this.col_burned.Width = 64;
- //
- // col_defaultTrack
- //
- this.col_defaultTrack.Text = "Default";
- this.col_defaultTrack.Width = 56;
- //
- // col_srtLang
- //
- this.col_srtLang.Text = "Srt Lang";
- this.col_srtLang.Width = 120;
- //
- // col_srtChar
- //
- this.col_srtChar.Text = "Srt CharCode";
- this.col_srtChar.Width = 120;
- //
- // col_srtOffset
- //
- this.col_srtOffset.Text = "Srt Offset (ms)";
- this.col_srtOffset.Width = 90;
- //
- // subMenu
- //
- this.subMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_moveup,
- this.mnu_movedown,
- this.toolStripSeparator2,
- this.mnu_remove});
- this.subMenu.Name = "audioMenu";
- this.subMenu.Size = new System.Drawing.Size(139, 76);
- //
- // mnu_moveup
- //
- this.mnu_moveup.Name = "mnu_moveup";
- this.mnu_moveup.Size = new System.Drawing.Size(138, 22);
- this.mnu_moveup.Text = "Move Up";
- this.mnu_moveup.Click += new System.EventHandler(this.MnuMoveupClick);
- //
- // mnu_movedown
- //
- this.mnu_movedown.Name = "mnu_movedown";
- this.mnu_movedown.Size = new System.Drawing.Size(138, 22);
- this.mnu_movedown.Text = "Move Down";
- this.mnu_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.mnu_movedown.Click += new System.EventHandler(this.MnuMovedownClick);
- //
- // toolStripSeparator2
- //
- this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(135, 6);
- //
- // mnu_remove
- //
- this.mnu_remove.Name = "mnu_remove";
- this.mnu_remove.Size = new System.Drawing.Size(138, 22);
- this.mnu_remove.Text = "Remove";
- this.mnu_remove.Click += new System.EventHandler(this.MnuRemoveClick);
- //
- // label68
- //
- this.label68.AutoSize = true;
- this.label68.BackColor = System.Drawing.Color.Transparent;
- this.label68.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label68.Location = new System.Drawing.Point(13, 13);
- this.label68.Name = "label68";
- this.label68.Size = new System.Drawing.Size(57, 13);
- this.label68.TabIndex = 67;
- this.label68.Text = "Subtitles";
- //
- // drp_subtitleTracks
- //
- this.drp_subtitleTracks.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drp_subtitleTracks.FormattingEnabled = true;
- this.drp_subtitleTracks.Location = new System.Drawing.Point(16, 69);
- this.drp_subtitleTracks.Name = "drp_subtitleTracks";
- this.drp_subtitleTracks.Size = new System.Drawing.Size(162, 21);
- this.drp_subtitleTracks.TabIndex = 74;
- this.drp_subtitleTracks.SelectedIndexChanged += new System.EventHandler(this.DrpSubtitleTracksSelectedIndexChanged);
- //
- // srt_offset
- //
- this.srt_offset.Enabled = false;
- this.srt_offset.Increment = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.srt_offset.Location = new System.Drawing.Point(620, 70);
- this.srt_offset.Maximum = new decimal(new int[] {
- 1000000000,
- 0,
- 0,
- 0});
- this.srt_offset.Minimum = new decimal(new int[] {
- 1000000000,
- 0,
- 0,
- -2147483648});
- this.srt_offset.Name = "srt_offset";
- this.srt_offset.Size = new System.Drawing.Size(58, 21);
- this.srt_offset.TabIndex = 79;
- this.toolTip.SetToolTip(this.srt_offset, "Adjust the offset in milliseconds between video and srt timestamps");
- this.srt_offset.ValueChanged += new System.EventHandler(this.SrtOffsetValueChanged);
- //
- // srt_lang
- //
- this.srt_lang.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.srt_lang.Enabled = false;
- this.srt_lang.FormattingEnabled = true;
- this.srt_lang.Location = new System.Drawing.Point(371, 69);
- this.srt_lang.Name = "srt_lang";
- this.srt_lang.Size = new System.Drawing.Size(114, 21);
- this.srt_lang.TabIndex = 50;
- this.srt_lang.SelectedIndexChanged += new System.EventHandler(this.SrtLangSelectedIndexChanged);
- //
- // srt_charcode
- //
- this.srt_charcode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.srt_charcode.Enabled = false;
- this.srt_charcode.FormattingEnabled = true;
- this.srt_charcode.Items.AddRange(new object[] {
- "ANSI_X3.4-1968",
- "ANSI_X3.4-1986",
- "ANSI_X3.4",
- "ANSI_X3.110-1983",
- "ANSI_X3.110",
- "ASCII",
- "ECMA-114",
- "ECMA-118",
- "ECMA-128",
- "ECMA-CYRILLIC",
- "IEC_P27-1",
- "ISO-8859-1",
- "ISO-8859-2",
- "ISO-8859-3",
- "ISO-8859-4",
- "ISO-8859-5",
- "ISO-8859-6",
- "ISO-8859-7",
- "ISO-8859-8",
- "ISO-8859-9",
- "ISO-8859-9E",
- "ISO-8859-10",
- "ISO-8859-11",
- "ISO-8859-13",
- "ISO-8859-14",
- "ISO-8859-15",
- "ISO-8859-16",
- "UTF-7",
- "UTF-8",
- "UTF-16",
- "UTF-32"});
- this.srt_charcode.Location = new System.Drawing.Point(495, 69);
- this.srt_charcode.Name = "srt_charcode";
- this.srt_charcode.Size = new System.Drawing.Size(101, 21);
- this.srt_charcode.TabIndex = 73;
- this.srt_charcode.SelectedIndexChanged += new System.EventHandler(this.SrtCharcodeSelectedIndexChanged);
- //
- // check_forced
- //
- this.check_forced.AutoSize = true;
- this.check_forced.Location = new System.Drawing.Point(208, 72);
- this.check_forced.Name = "check_forced";
- this.check_forced.Size = new System.Drawing.Size(15, 14);
- this.check_forced.TabIndex = 75;
- this.check_forced.UseVisualStyleBackColor = true;
- this.check_forced.CheckedChanged += new System.EventHandler(this.CheckForcedCheckedChanged);
- //
- // check_default
- //
- this.check_default.AutoSize = true;
- this.check_default.Location = new System.Drawing.Point(334, 72);
- this.check_default.Name = "check_default";
- this.check_default.Size = new System.Drawing.Size(15, 14);
- this.check_default.TabIndex = 77;
- this.check_default.UseVisualStyleBackColor = true;
- this.check_default.CheckedChanged += new System.EventHandler(this.CheckDefaultCheckedChanged);
- //
- // check_burned
- //
- this.check_burned.AutoSize = true;
- this.check_burned.Location = new System.Drawing.Point(274, 72);
- this.check_burned.Name = "check_burned";
- this.check_burned.Size = new System.Drawing.Size(15, 14);
- this.check_burned.TabIndex = 76;
- this.check_burned.UseVisualStyleBackColor = true;
- this.check_burned.CheckedChanged += new System.EventHandler(this.CheckBurnedCheckedChanged);
- //
- // btn_srtAdd
- //
- this.btn_srtAdd.BackColor = System.Drawing.Color.Transparent;
- this.btn_srtAdd.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_srtAdd.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.btn_srtAdd.Location = new System.Drawing.Point(179, 38);
- this.btn_srtAdd.Name = "btn_srtAdd";
- this.btn_srtAdd.Size = new System.Drawing.Size(88, 23);
- this.btn_srtAdd.TabIndex = 73;
- this.btn_srtAdd.Text = "Import SRT";
- this.toolTip.SetToolTip(this.btn_srtAdd, "Add a new SRT file to the \"track\" dropdown menu.");
- this.btn_srtAdd.UseVisualStyleBackColor = false;
- this.btn_srtAdd.Click += new System.EventHandler(this.BtnSrtAddClick);
- //
- // openFileDialog
- //
- this.openFileDialog.DefaultExt = "srt";
- this.openFileDialog.Filter = "SRT Files |*.srt";
- //
- // btn_addSubtitleTrack
- //
- this.btn_addSubtitleTrack.AutoSize = true;
- this.btn_addSubtitleTrack.ContextMenuStrip = this.SubtitleTrackMenu;
- this.btn_addSubtitleTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_addSubtitleTrack.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_addSubtitleTrack.Location = new System.Drawing.Point(16, 38);
- this.btn_addSubtitleTrack.Name = "btn_addSubtitleTrack";
- this.btn_addSubtitleTrack.Size = new System.Drawing.Size(69, 23);
- this.btn_addSubtitleTrack.SplitMenuStrip = this.SubtitleTrackMenu;
- this.btn_addSubtitleTrack.TabIndex = 80;
- this.btn_addSubtitleTrack.Text = "Add";
- this.btn_addSubtitleTrack.UseVisualStyleBackColor = true;
- this.btn_addSubtitleTrack.Click += new System.EventHandler(this.btn_addSubtitleTrack_Click);
- //
- // SubtitleTrackMenu
- //
- this.SubtitleTrackMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_AddAll,
- this.mnu_AddAllCC});
- this.SubtitleTrackMenu.Name = "audioMenu";
- this.SubtitleTrackMenu.Size = new System.Drawing.Size(196, 48);
- //
- // mnu_AddAll
- //
- this.mnu_AddAll.Name = "mnu_AddAll";
- this.mnu_AddAll.Size = new System.Drawing.Size(195, 22);
- this.mnu_AddAll.Text = "Add All";
- this.mnu_AddAll.Click += new System.EventHandler(this.mnu_AddAll_Click);
- //
- // mnu_AddAllCC
- //
- this.mnu_AddAllCC.Name = "mnu_AddAllCC";
- this.mnu_AddAllCC.Size = new System.Drawing.Size(195, 22);
- this.mnu_AddAllCC.Text = "Add all Closed Caption";
- this.mnu_AddAllCC.Click += new System.EventHandler(this.mnu_AddAllCC_Click);
- //
- // SubtitleRemoveButtonMenu
- //
- this.SubtitleRemoveButtonMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnu_ClearAll});
- this.SubtitleRemoveButtonMenu.Name = "audioMenu";
- this.SubtitleRemoveButtonMenu.Size = new System.Drawing.Size(153, 48);
- //
- // mnu_ClearAll
- //
- this.mnu_ClearAll.Name = "mnu_ClearAll";
- this.mnu_ClearAll.Size = new System.Drawing.Size(152, 22);
- this.mnu_ClearAll.Text = "Clear All";
- this.mnu_ClearAll.Click += new System.EventHandler(this.mnu_ClearAll_Click);
- //
- // btn_RemoveTrack
- //
- this.btn_RemoveTrack.AutoSize = true;
- this.btn_RemoveTrack.ContextMenuStrip = this.SubtitleRemoveButtonMenu;
- this.btn_RemoveTrack.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_RemoveTrack.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_RemoveTrack.Location = new System.Drawing.Point(91, 38);
- this.btn_RemoveTrack.Name = "btn_RemoveTrack";
- this.btn_RemoveTrack.Size = new System.Drawing.Size(82, 23);
- this.btn_RemoveTrack.SplitMenuStrip = this.SubtitleRemoveButtonMenu;
- this.btn_RemoveTrack.TabIndex = 82;
- this.btn_RemoveTrack.Text = "Remove";
- this.btn_RemoveTrack.UseVisualStyleBackColor = true;
- this.btn_RemoveTrack.Click += new System.EventHandler(this.btn_RemoveTrack_Click);
- //
- // Subtitles
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.drp_subtitleTracks);
- this.Controls.Add(this.srt_offset);
- this.Controls.Add(this.srt_lang);
- this.Controls.Add(this.btn_RemoveTrack);
- this.Controls.Add(this.srt_charcode);
- this.Controls.Add(this.btn_addSubtitleTrack);
- this.Controls.Add(this.label68);
- this.Controls.Add(this.lv_subList);
- this.Controls.Add(this.check_forced);
- this.Controls.Add(this.check_burned);
- this.Controls.Add(this.check_default);
- this.Controls.Add(this.btn_srtAdd);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "Subtitles";
- this.Size = new System.Drawing.Size(719, 300);
- this.subMenu.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.srt_offset)).EndInit();
- this.SubtitleTrackMenu.ResumeLayout(false);
- this.SubtitleRemoveButtonMenu.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- internal System.Windows.Forms.ListView lv_subList;
- private System.Windows.Forms.ColumnHeader col_Source;
- private System.Windows.Forms.ColumnHeader col_forced;
- private System.Windows.Forms.ColumnHeader col_burned;
- internal System.Windows.Forms.Label label68;
- private System.Windows.Forms.ColumnHeader col_defaultTrack;
- private System.Windows.Forms.ContextMenuStrip subMenu;
- private System.Windows.Forms.ToolStripMenuItem mnu_moveup;
- private System.Windows.Forms.ToolStripMenuItem mnu_movedown;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
- private System.Windows.Forms.ToolStripMenuItem mnu_remove;
- private System.Windows.Forms.Button btn_srtAdd;
- private System.Windows.Forms.ColumnHeader col_srtChar;
- private System.Windows.Forms.ColumnHeader col_srtOffset;
- internal System.Windows.Forms.ComboBox srt_charcode;
- internal System.Windows.Forms.ComboBox srt_lang;
- private System.Windows.Forms.NumericUpDown srt_offset;
- private System.Windows.Forms.OpenFileDialog openFileDialog;
- private System.Windows.Forms.CheckBox check_default;
- private System.Windows.Forms.CheckBox check_burned;
- private System.Windows.Forms.CheckBox check_forced;
- internal System.Windows.Forms.ComboBox drp_subtitleTracks;
- private System.Windows.Forms.ColumnHeader col_srtLang;
- private System.Windows.Forms.ToolTip toolTip;
- private wyDay.Controls.SplitButton btn_addSubtitleTrack;
- private System.Windows.Forms.ContextMenuStrip SubtitleTrackMenu;
- private System.Windows.Forms.ToolStripMenuItem mnu_AddAll;
- private System.Windows.Forms.ToolStripMenuItem mnu_AddAllCC;
- private System.Windows.Forms.ContextMenuStrip SubtitleRemoveButtonMenu;
- private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll;
- private wyDay.Controls.SplitButton btn_RemoveTrack;
- }
-}
diff --git a/win/CS/Controls/Subtitles.cs b/win/CS/Controls/Subtitles.cs
deleted file mode 100644
index a31c941b7..000000000
--- a/win/CS/Controls/Subtitles.cs
+++ /dev/null
@@ -1,938 +0,0 @@
-/* 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. */
-
-namespace Handbrake.Controls
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.ComponentModel;
- using System.IO;
- using System.Linq;
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices;
- using HandBrake.ApplicationServices.Model.Encoding;
- using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Services.Interfaces;
- using HandBrake.ApplicationServices.Utilities;
-
- /// <summary>
- /// The Subtitles Tab
- /// </summary>
- public partial class Subtitles : UserControl
- {
- #region Priavate Variables and Collections
-
- /// <summary>
- /// Map of languages to language codes
- /// </summary>
- private readonly IDictionary<string, string> langMap = new Dictionary<string, string>();
-
- /// <summary>
- /// A List of SRT Files
- /// </summary>
- private readonly IDictionary<string, string> srtFiles = new Dictionary<string, string>();
-
- /// <summary>
- /// The Subtitle List
- /// </summary>
- private readonly List<SubtitleTrack> subList = new List<SubtitleTrack>();
-
- /// <summary>
- /// The User Setting Service.
- /// </summary>
- private static readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;
-
- /// <summary>
- /// The current output extension
- /// </summary>
- private string currentOutputExtension;
- #endregion
-
- /// <summary>
- /// Initializes a new instance of the <see cref="Subtitles"/> class.
- /// </summary>
- public Subtitles()
- {
- InitializeComponent();
-
- langMap = LanguageUtilities.MapLanguages();
- foreach (string key in langMap.Keys)
- srt_lang.Items.Add(key);
-
- srt_charcode.SelectedIndex = 28;
- srt_lang.SelectedIndex = 40;
- }
-
- /// <summary>
- /// Gets SubtitlesList.
- /// </summary>
- public List<SubtitleTrack> SubtitlesList
- {
- get
- {
- return subList;
- }
- }
-
- #region Public Methods
- /// <summary>
- /// Gets the CLI Query for this panel
- /// </summary>
- /// <returns>A CliQuery string</returns>
- public string GetCliQuery
- {
- get
- {
- string query = string.Empty;
- if (lv_subList.Items.Count != 0) // If we have subtitle tracks
- {
- // BitMap and CC's
- string subtitleTracks = String.Empty;
- string subtitleForced = String.Empty;
- string subtitleBurn = String.Empty;
- string subtitleDefault = String.Empty;
-
- // SRT
- string srtFile = String.Empty;
- string srtCodeset = String.Empty;
- string srtOffset = String.Empty;
- string srtLang = String.Empty;
- string srtDefault = String.Empty;
- int srtCount = 0;
- int subCount = 0;
-
- foreach (SubtitleTrack item in subList)
- {
- string itemToAdd;
-
- if (item.IsSrtSubtitle) // We have an SRT file
- {
- srtCount++; // SRT track id.
-
- srtLang += srtLang == string.Empty ? langMap[item.SrtLang] : "," + langMap[item.SrtLang];
- srtCodeset += srtCodeset == string.Empty ? item.SrtCharCode : "," + item.SrtCharCode;
-
- if (item.Default)
- srtDefault = srtCount.ToString();
-
- itemToAdd = item.SrtPath;
- srtFile += srtFile == string.Empty ? itemToAdd : "," + itemToAdd;
-
- itemToAdd = item.SrtOffset.ToString();
- srtOffset += srtOffset == string.Empty ? itemToAdd : "," + itemToAdd;
- }
- else // We have Bitmap or CC
- {
- subCount++;
-
- // Find --subtitle <string>
- if (item.Track.Contains("Foreign Audio Search"))
- itemToAdd = "scan";
- else
- {
- string[] tempSub = item.Track.Split(' ');
- itemToAdd = tempSub[0];
- }
-
- subtitleTracks += subtitleTracks == string.Empty ? itemToAdd : "," + itemToAdd;
-
- // Find --subtitle-forced
- if (item.Forced)
- subtitleForced += subtitleForced == string.Empty ? subCount.ToString() : "," + subCount;
-
- // Find --subtitle-burn
- if (item.Burned)
- subtitleBurn = subCount.ToString();
-
- // Find --subtitle-default
- if (item.Default)
- subtitleDefault = subCount.ToString();
- }
- }
-
- // Build The CLI Subtitles Query
- if (subtitleTracks != string.Empty)
- {
- query += " --subtitle " + subtitleTracks;
-
- if (subtitleForced != string.Empty)
- query += " --subtitle-forced=" + subtitleForced;
- if (subtitleBurn != string.Empty)
- query += " --subtitle-burn=" + subtitleBurn;
- if (subtitleDefault != string.Empty)
- query += " --subtitle-default=" + subtitleDefault;
- }
-
- if (srtFile != string.Empty) // SRTs
- {
- query += " --srt-file " + "\"" + srtFile + "\"";
-
- if (srtCodeset != string.Empty)
- query += " --srt-codeset " + srtCodeset;
- if (srtOffset != string.Empty)
- query += " --srt-offset " + srtOffset;
- if (srtLang != string.Empty)
- query += " --srt-lang " + srtLang;
- if (srtDefault != string.Empty)
- query += " --srt-default=" + srtDefault;
- }
- }
- return query;
- }
- }
-
- /// <summary>
- /// Checks of the current settings will require the m4v file extension
- /// </summary>
- /// <returns>True if Yes</returns>
- public bool RequiresM4V()
- {
- return this.subList.Any(track => track.SubtitleType != SubtitleType.VobSub);
- }
-
- /// <summary>
- /// Set the current extension to allow this window to behave correctly based on extension.
- /// </summary>
- /// <param name="extension">
- /// The extension.
- /// </param>
- public void SetExtension(string extension)
- {
- currentOutputExtension = extension.Replace(".", string.Empty);
- }
-
- /// <summary>
- /// Automatically setup the subtitle tracks.
- /// This handles the automatic setup of subitles which the user can control from the program options
- /// </summary>
- /// <param name="subs">List of Subtitles</param>
- public void SetSubtitleTrackAuto(object[] subs)
- {
- drp_subtitleTracks.Items.Clear();
- drp_subtitleTracks.Items.Add("Foreign Audio Search (Bitmap)");
- drp_subtitleTracks.Items.AddRange(subs);
- drp_subtitleTracks.SelectedIndex = 0;
- Clear();
-
- this.AutomaticSubtitleSelection();
- }
-
- /// <summary>
- /// Automatic Subtitle Selection based on user preferences.
- /// </summary>
- public void AutomaticSubtitleSelection()
- {
- // Avoid trying to add elements when no subtitles are there.
- if (drp_subtitleTracks.Items.Count < 2)
- {
- return;
- }
-
- this.Clear();
-
- // Array with the Index numbers of the prefered and additional languages.
- // This allows to have for each language the order in which they appear in the DVD list.
- Dictionary<String, ArrayList> languageIndex = new Dictionary<String, ArrayList>();
-
- // This is used to keep the Prefered Language in the front and the other languages in order.
- ArrayList languageOrder = new ArrayList();
-
- // New DUB Settings
- int mode = UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);
-
- // Native Language is not 'Any', so initialising the Language Dictionary
- if (mode >= 3)
- {
- languageIndex.Add(UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguageForSubtitles), new ArrayList());
- languageOrder.Add(UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguageForSubtitles));
-
- foreach (string item in UserSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))
- {
- if (!languageIndex.ContainsKey(item))
- {
- languageIndex.Add(item, new ArrayList());
- languageOrder.Add(item);
- }
- }
-
- bool elementFound = false;
- int i = 0;
- foreach (object item in drp_subtitleTracks.Items)
- {
- foreach (KeyValuePair<String, ArrayList> kvp in languageIndex)
- {
- if (item.ToString().Contains(kvp.Key))
- {
- kvp.Value.Add(i);
- elementFound = true;
- }
- }
-
- i++;
- }
-
- // If there are no selected languages found, the first available will be taken.
- if (!elementFound)
- mode = 2;
- }
-
- switch (mode)
- {
- case 1: // Adding all audio tracks
- for (int i = 1; i < drp_subtitleTracks.Items.Count; i++)
- {
- drp_subtitleTracks.SelectedIndex = i;
- this.btn_addSubtitleTrack_Click(this, new EventArgs());
- }
- break;
- case 2: // Adding only the first Audio Track
- drp_subtitleTracks.SelectedIndex = 1;
- if (drp_subtitleTracks.SelectedItem != null)
- this.btn_addSubtitleTrack_Click(this, new EventArgs());
- break;
- case 3: // Selected Languages Only
- foreach (string item in languageOrder)
- {
- if (languageIndex[item].Count > 0)
- {
- foreach (int i in languageIndex[item])
- {
- drp_subtitleTracks.SelectedIndex = i;
- if (drp_subtitleTracks.SelectedItem != null)
- {
- this.btn_addSubtitleTrack_Click(this, new EventArgs());
- }
- }
- }
- }
- break;
- case 4: // Prefered Only
- case 5: // Prefered Only All
- if (languageIndex[(string)languageOrder[0]].Count > 0)
- {
- foreach (int i in languageIndex[(string)languageOrder[0]])
- {
- drp_subtitleTracks.SelectedIndex = i;
- if (drp_subtitleTracks.SelectedItem != null)
- {
- this.btn_addSubtitleTrack_Click(this, new EventArgs());
- if (mode == 4)
- {
- // Mode 4 is First, 5 is All
- break;
- }
- }
- }
- }
- break;
- }
-
- // Revert the selection back tio the first item.
- drp_subtitleTracks.SelectedIndex = 0;
-
- // Add Closed Captions if the user has the option enabled.
- if (UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption))
- {
- foreach (object item in drp_subtitleTracks.Items)
- {
- if (item.ToString().Contains("Closed"))
- {
- drp_subtitleTracks.SelectedItem = item;
- btn_addSubtitleTrack_Click(this, EventArgs.Empty);
- }
- }
- }
- }
-
- /// <summary>
- /// Clear the Subtitle List
- /// </summary>
- public void Clear()
- {
- lv_subList.Items.Clear();
- subList.Clear();
- srtFiles.Clear();
- }
- #endregion
-
- #region Primary Controls
-
- /// <summary>
- /// Add a subtitle Track
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void btn_addSubtitleTrack_Click(object sender, EventArgs e)
- {
- if (drp_subtitleTracks.SelectedItem == null)
- {
- MessageBox.Show("No Subtitle Track Selected.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
-
- // Logic
- string srtCode = "-", srtLangVal = "-", srtPath = "-", srtFile = "-";
- int srtOffsetMs = 0;
-
- // Make sure we only have 1 burned track. We'll always give the latest track added burned in.
- if (check_burned.Checked)
- this.SetBurnedToOffForAllTracks();
-
- // Make sure we only have 1 default track
- if (check_default.Checked)
- this.SetDefaultToOffForAllTracks();
-
- if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- {
- srtFiles.TryGetValue(drp_subtitleTracks.SelectedItem.ToString(), out srtPath);
- srtFile = drp_subtitleTracks.SelectedItem.ToString();
- srtLangVal = srt_lang.SelectedItem.ToString();
- srtCode = srt_charcode.SelectedItem.ToString();
- srtOffsetMs = (int)srt_offset.Value;
- }
-
- string trackName = (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- ? srtLangVal + " (" + srtFile + ")"
- : drp_subtitleTracks.SelectedItem.ToString();
-
- SubtitleTrack track = new SubtitleTrack
- {
- Track = trackName,
- Forced = check_forced.Checked,
- Burned = check_burned.Checked,
- Default = check_default.Checked,
- SrtLang = srtLangVal,
- SrtCharCode = srtCode,
- SrtOffset = srtOffsetMs,
- SrtPath = srtPath,
- SrtFileName = srtFile
- };
-
- Subtitle subtitle = drp_subtitleTracks.SelectedItem as Subtitle;
- if (subtitle != null)
- {
- track.SubtitleType = ((Subtitle)drp_subtitleTracks.SelectedItem).SubtitleType;
- }
- else if (drp_subtitleTracks.SelectedItem != null && drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- {
- track.SubtitleType = SubtitleType.SRT;
- }
-
- if (currentOutputExtension.Equals("mp4", StringComparison.InvariantCultureIgnoreCase) ||
- currentOutputExtension.Equals("m4v", StringComparison.CurrentCultureIgnoreCase))
- {
- // Default it to burned as mp4 doesn't allow PGS
- track.Burned = true;
-
- // Check to make sure we don't have more than one PGS. Fail if we do.
- if (this.subList.Any(item => item.SubtitleType == SubtitleType.PGS))
- {
- MessageBox.Show(
- "You can only burn-in one PGS subtitle track into an MP4 file. You must first remove the current track to add a new one.",
- "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- return;
- }
- }
-
- lv_subList.Items.Add(track.ListView);
- subList.Add(track);
- }
-
- /// <summary>
- /// Add all audio tracks.
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void mnu_AddAll_Click(object sender, EventArgs e)
- {
- // TODO - Might need to be a bit more clever with this. Will wait and see if this causes any problems.
- bool addedPGS = false;
- foreach (object item in drp_subtitleTracks.Items)
- {
- Subtitle sub = item as Subtitle;
-
- // PGS Handling.
- if (addedPGS)
- {
- // Skip over any pgs tracks after we've added the first.
- continue;
- }
-
- if (currentOutputExtension.Equals("mp4", StringComparison.InvariantCultureIgnoreCase) ||
- currentOutputExtension.Equals("m4v", StringComparison.CurrentCultureIgnoreCase))
- {
- if (sub != null && sub.SubtitleType == SubtitleType.PGS)
- {
- addedPGS = true;
- }
- }
-
- if (!item.ToString().Contains("Foreign Audio Search"))
- {
- drp_subtitleTracks.SelectedItem = item;
- btn_addSubtitleTrack_Click(this, EventArgs.Empty);
- }
- }
-
-
- }
-
- /// <summary>
- /// Add all closed caption tracks
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void mnu_AddAllCC_Click(object sender, EventArgs e)
- {
- foreach (object item in drp_subtitleTracks.Items)
- {
- if (item.ToString().Contains("Closed"))
- {
- drp_subtitleTracks.SelectedItem = item;
- btn_addSubtitleTrack_Click(this, EventArgs.Empty);
- }
- }
- }
-
- /// <summary>
- /// Clear all tracks.
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void mnu_ClearAll_Click(object sender, EventArgs e)
- {
- lv_subList.Items.Clear();
- subList.Clear();
- }
-
- /// <summary>
- /// Remvoe a track
- /// </summary>
- /// <param name="sender">
- /// The Sender
- /// </param>
- /// <param name="e">
- /// The Event Args
- /// </param>
- private void btn_RemoveTrack_Click(object sender, EventArgs e)
- {
- this.RemoveSelectedTrack();
- }
-
- /// <summary>
- /// Import an SRT Subtitle Track
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void BtnSrtAddClick(object sender, EventArgs e)
- {
- if (openFileDialog.ShowDialog() != DialogResult.OK)
- return;
-
- if (srtFiles.ContainsKey(Path.GetFileName(openFileDialog.FileName)))
- {
- MessageBox.Show(
- "A Subtitle track with the same name has already been imported.",
- "Warning",
- MessageBoxButtons.OK,
- MessageBoxIcon.Warning);
- return;
- }
-
- drp_subtitleTracks.Items.Add(Path.GetFileName(openFileDialog.FileName));
- drp_subtitleTracks.SelectedItem = Path.GetFileName(openFileDialog.FileName);
- srtFiles.Add(Path.GetFileName(openFileDialog.FileName), openFileDialog.FileName);
- }
-
- /// <summary>
- /// The Subtitle List selected index has changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void LbSubListSelectedIndexChanged(object sender, EventArgs e)
- {
- // Set the dropdown controls based on the selected item in the List.
- if (lv_subList.Items.Count != 0 && lv_subList.SelectedIndices.Count != 0)
- {
- SubtitleTrack track = subList[lv_subList.SelectedIndices[0]];
-
- int c = 0;
- if (lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text.ToLower().Contains(".srt"))
- // We have an SRT
- {
- foreach (var item in drp_subtitleTracks.Items)
- {
- if (item.ToString() == track.SrtFileName)
- drp_subtitleTracks.SelectedIndex = c;
- c++;
- }
- srt_lang.SelectedItem = track.SrtLang;
- srt_offset.Value = track.SrtOffset;
- srt_charcode.SelectedItem = track.SrtCharCode;
- check_default.CheckState = track.Default ? CheckState.Checked : CheckState.Unchecked;
- }
- else // We have Bitmap/CC
- {
- foreach (var item in drp_subtitleTracks.Items)
- {
- if (item.ToString() == track.Track)
- drp_subtitleTracks.SelectedIndex = c;
- c++;
- }
- check_forced.CheckState = track.Forced ? CheckState.Checked : CheckState.Unchecked;
- check_burned.CheckState = track.Burned ? CheckState.Checked : CheckState.Unchecked;
- check_default.CheckState = track.Default ? CheckState.Checked : CheckState.Unchecked;
- }
- }
- }
-
- #endregion
-
- #region Subtitle Controls
-
- /// <summary>
- /// Handle the Subtitle track dropdown changed event
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void DrpSubtitleTracksSelectedIndexChanged(object sender, EventArgs e)
- {
- if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- {
- check_forced.Enabled = false;
- check_burned.Enabled = false;
- srt_lang.Enabled = true;
- srt_charcode.Enabled = true;
- srt_offset.Enabled = true;
- }
- else
- {
- check_forced.Enabled = true;
- check_burned.Enabled = true;
- srt_lang.Enabled = false;
- srt_charcode.Enabled = false;
- srt_offset.Enabled = false;
- }
- // Update an item in the list if required.
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- if (drp_subtitleTracks.SelectedItem.ToString().Contains(".srt"))
- {
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text = srt_lang.SelectedItem + "(" +
- drp_subtitleTracks.SelectedItem + ")";
- lv_subList.Select();
-
- string srtPath;
- srtFiles.TryGetValue(drp_subtitleTracks.SelectedItem.ToString(), out srtPath);
- subList[lv_subList.SelectedIndices[0]].SrtPath = srtPath;
- }
- else
- {
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[0].Text =
- drp_subtitleTracks.SelectedItem.ToString();
- lv_subList.Select();
- }
-
- subList[lv_subList.SelectedIndices[0]].Track = drp_subtitleTracks.SelectedItem.ToString();
- }
-
- /// <summary>
- /// Foreced Subtitles checkbox changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void CheckForcedCheckedChanged(object sender, EventArgs e)
- {
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[1].Text = check_forced.Checked ? "Yes" : "No";
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].Forced = check_forced.Checked;
- // Update SubList List<SubtitleInfo>
- }
-
- /// <summary>
- /// Burned in subtitles checkbox changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void CheckBurnedCheckedChanged(object sender, EventArgs e)
- {
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- if (check_burned.Checked) // Make sure we only have 1 burned track
- this.SetBurnedToOffForAllTracks();
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[2].Text = check_burned.Checked ? "Yes" : "No";
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].Burned = check_burned.Checked;
- // Update SubList List<SubtitleInfo>
- }
-
- /// <summary>
- /// Default Subitle track check changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void CheckDefaultCheckedChanged(object sender, EventArgs e)
- {
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- if (check_default.Checked) // Make sure we only have 1 default track
- this.SetDefaultToOffForAllTracks();
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[3].Text = check_default.Checked ? "Yes" : "No";
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].Default = check_default.Checked;
- // Update SubList List<SubtitleInfo>
- }
-
- /// <summary>
- /// Srt Offset Numeric Control Changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void SrtOffsetValueChanged(object sender, EventArgs e)
- {
- // Update an item in the list if required.
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0)
- return;
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[6].Text = srt_offset.Value.ToString();
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].SrtOffset = (int)srt_offset.Value;
- // Update SubList List<SubtitleInfo>
- }
-
- /// <summary>
- /// The SRT Charcode changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void SrtCharcodeSelectedIndexChanged(object sender, EventArgs e)
- {
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[5].Text = srt_charcode.SelectedItem.ToString();
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].SrtCharCode = srt_charcode.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
- }
-
- /// <summary>
- /// The Srt Language code changed
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void SrtLangSelectedIndexChanged(object sender, EventArgs e)
- {
- if (lv_subList.Items.Count == 0 || lv_subList.SelectedIndices.Count == 0) return;
-
- lv_subList.Items[lv_subList.SelectedIndices[0]].SubItems[4].Text = srt_lang.SelectedItem.ToString();
- lv_subList.Select();
-
- subList[lv_subList.SelectedIndices[0]].SrtLang = srt_lang.SelectedItem.ToString();
- // Update SubList List<SubtitleInfo>
- }
-
- #endregion
-
- #region Right Click Menu
-
- /// <summary>
- /// Move an item in the subtitle list up
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void MnuMoveupClick(object sender, EventArgs e)
- {
- if (lv_subList.SelectedIndices.Count != 0)
- {
- ListViewItem item = lv_subList.SelectedItems[0];
- int index = item.Index;
- index--;
-
- if (lv_subList.Items.Count > index && index >= 0)
- {
- lv_subList.Items.Remove(item);
- lv_subList.Items.Insert(index, item);
- item.Selected = true;
- lv_subList.Focus();
- }
- }
- }
-
- /// <summary>
- /// Move an item in the subtitle list down
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void MnuMovedownClick(object sender, EventArgs e)
- {
- if (lv_subList.SelectedIndices.Count != 0)
- {
- ListViewItem item = lv_subList.SelectedItems[0];
- int index = item.Index;
- index++;
-
- if (index < lv_subList.Items.Count)
- {
- lv_subList.Items.Remove(item);
- lv_subList.Items.Insert(index, item);
- item.Selected = true;
- lv_subList.Focus();
- }
- }
- }
-
- /// <summary>
- /// Remove a selected subtitle track.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The e.
- /// </param>
- private void MnuRemoveClick(object sender, EventArgs e)
- {
- this.RemoveSelectedTrack();
- }
-
- #endregion
-
- #region Helpers
- /// <summary>
- /// Set all Non SRT tracks to Default = NO
- /// </summary>
- private void SetDefaultToOffForAllTracks()
- {
- int c = 0;
- foreach (ListViewItem item in lv_subList.Items)
- {
- if (item.SubItems[3].Text == "Yes")
- {
- item.SubItems[3].Text = "No";
- subList[c].Default = false;
- }
- c++;
- }
- }
-
- /// <summary>
- /// Set all tracks to Burned = No
- /// </summary>
- private void SetBurnedToOffForAllTracks()
- {
- int c = 0;
- foreach (ListViewItem item in lv_subList.Items)
- {
- if (item.SubItems[2].Text == "Yes")
- {
- item.SubItems[2].Text = "No";
- subList[c].Burned = false;
- }
- c++;
- }
- }
-
- /// <summary>
- /// Remove a selected track
- /// </summary>
- private void RemoveSelectedTrack()
- {
- // Remove the Item and reselect the control if the following conditions are met.
- if (lv_subList.SelectedItems.Count != 0)
- {
- // Record the current selected index.
- int currentPosition = lv_subList.SelectedIndices[0];
- int selectedInd = lv_subList.SelectedIndices[0];
-
- lv_subList.Items.RemoveAt(selectedInd);
- subList.RemoveAt(selectedInd);
-
- // Now reslect the correct item and give focus to the list.
- if (lv_subList.Items.Count != 0)
- {
- if (currentPosition <= (lv_subList.Items.Count - 1))
- lv_subList.Items[currentPosition].Selected = true;
- else if (currentPosition > (lv_subList.Items.Count - 1))
- lv_subList.Items[lv_subList.Items.Count - 1].Selected = true;
-
- lv_subList.Select();
- }
- }
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/Subtitles.resx b/win/CS/Controls/Subtitles.resx
deleted file mode 100644
index 1254679cb..000000000
--- a/win/CS/Controls/Subtitles.resx
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="subMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>237, 17</value>
- </metadata>
- <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>113, 17</value>
- </metadata>
- <metadata name="SubtitleTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>317, 20</value>
- </metadata>
- <metadata name="SubtitleRemoveButtonMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>471, 20</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/win/CS/Controls/x264Panel.Designer.cs b/win/CS/Controls/x264Panel.Designer.cs
deleted file mode 100644
index dfc21b6d5..000000000
--- a/win/CS/Controls/x264Panel.Designer.cs
+++ /dev/null
@@ -1,775 +0,0 @@
-/* x264Panel.Designer.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. */
-
-namespace Handbrake.Controls
-{
- partial class x264Panel
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(x264Panel));
- this.slider_psytrellis = new System.Windows.Forms.TrackBar();
- this.lbl_psytrellis = new System.Windows.Forms.Label();
- this.lbl_psyrd = new System.Windows.Forms.Label();
- this.slider_psyrd = new System.Windows.Forms.TrackBar();
- this.lbl_adaptBFrames = new System.Windows.Forms.Label();
- this.drop_adaptBFrames = new System.Windows.Forms.ComboBox();
- this.label43 = new System.Windows.Forms.Label();
- this.btn_reset = new System.Windows.Forms.Button();
- this.rtf_x264Query = new System.Windows.Forms.RichTextBox();
- this.check_Cabac = new System.Windows.Forms.CheckBox();
- this.check_noDCTDecimate = new System.Windows.Forms.CheckBox();
- this.lbl_trellis = new System.Windows.Forms.Label();
- this.drop_trellis = new System.Windows.Forms.ComboBox();
- this.drop_deblockBeta = new System.Windows.Forms.ComboBox();
- this.label41 = new System.Windows.Forms.Label();
- this.drop_deblockAlpha = new System.Windows.Forms.ComboBox();
- this.check_8x8DCT = new System.Windows.Forms.CheckBox();
- this.label45 = new System.Windows.Forms.Label();
- this.drop_analysis = new System.Windows.Forms.ComboBox();
- this.label48 = new System.Windows.Forms.Label();
- this.drop_subpixelMotionEstimation = new System.Windows.Forms.ComboBox();
- this.lbl_merange = new System.Windows.Forms.Label();
- this.drop_MotionEstimationRange = new System.Windows.Forms.ComboBox();
- this.label54 = new System.Windows.Forms.Label();
- this.drop_MotionEstimationMethod = new System.Windows.Forms.ComboBox();
- this.lbl_direct_prediction = new System.Windows.Forms.Label();
- this.drop_directPrediction = new System.Windows.Forms.ComboBox();
- this.label62 = new System.Windows.Forms.Label();
- this.drop_bFrames = new System.Windows.Forms.ComboBox();
- this.label64 = new System.Windows.Forms.Label();
- this.drop_refFrames = new System.Windows.Forms.ComboBox();
- this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
- this.check_weightp = new System.Windows.Forms.CheckBox();
- this.slider_adaptiveQuantStrength = new System.Windows.Forms.TrackBar();
- this.combo_pyrmidalBFrames = new System.Windows.Forms.ComboBox();
- this.lbl_adaptiveQuantStrength = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.lbl_prymidalBframes = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- ((System.ComponentModel.ISupportInitialize)(this.slider_psytrellis)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.slider_psyrd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.slider_adaptiveQuantStrength)).BeginInit();
- this.SuspendLayout();
- //
- // slider_psytrellis
- //
- this.slider_psytrellis.BackColor = System.Drawing.SystemColors.Window;
- this.slider_psytrellis.Location = new System.Drawing.Point(427, 231);
- this.slider_psytrellis.Maximum = 20;
- this.slider_psytrellis.Name = "slider_psytrellis";
- this.slider_psytrellis.Size = new System.Drawing.Size(131, 45);
- this.slider_psytrellis.TabIndex = 86;
- this.ToolTip.SetToolTip(this.slider_psytrellis, "Psychovisual Trellis tries to retain more sharpness and detail, but can cause art" +
- "ifacting. \r\nIt is considered experimental, which is why it\'s off by default. Goo" +
- "d values are 0.1 to 0.2.");
- this.slider_psytrellis.Scroll += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_psytrellis
- //
- this.lbl_psytrellis.AutoSize = true;
- this.lbl_psytrellis.Location = new System.Drawing.Point(309, 231);
- this.lbl_psytrellis.Name = "lbl_psytrellis";
- this.lbl_psytrellis.Size = new System.Drawing.Size(102, 13);
- this.lbl_psytrellis.TabIndex = 85;
- this.lbl_psytrellis.Text = "Psychovisual Trellis:";
- //
- // lbl_psyrd
- //
- this.lbl_psyrd.AutoSize = true;
- this.lbl_psyrd.Location = new System.Drawing.Point(264, 199);
- this.lbl_psyrd.Name = "lbl_psyrd";
- this.lbl_psyrd.Size = new System.Drawing.Size(147, 13);
- this.lbl_psyrd.TabIndex = 84;
- this.lbl_psyrd.Text = "Psychovisual Rate Distortion:";
- //
- // slider_psyrd
- //
- this.slider_psyrd.BackColor = System.Drawing.SystemColors.Window;
- this.slider_psyrd.Location = new System.Drawing.Point(425, 199);
- this.slider_psyrd.Maximum = 20;
- this.slider_psyrd.Name = "slider_psyrd";
- this.slider_psyrd.Size = new System.Drawing.Size(131, 45);
- this.slider_psyrd.TabIndex = 83;
- this.ToolTip.SetToolTip(this.slider_psyrd, resources.GetString("slider_psyrd.ToolTip"));
- this.slider_psyrd.Value = 10;
- this.slider_psyrd.Scroll += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_adaptBFrames
- //
- this.lbl_adaptBFrames.AutoSize = true;
- this.lbl_adaptBFrames.Location = new System.Drawing.Point(309, 28);
- this.lbl_adaptBFrames.Name = "lbl_adaptBFrames";
- this.lbl_adaptBFrames.Size = new System.Drawing.Size(102, 13);
- this.lbl_adaptBFrames.TabIndex = 81;
- this.lbl_adaptBFrames.Text = "Adaptive B-Frames:";
- //
- // drop_adaptBFrames
- //
- this.drop_adaptBFrames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_adaptBFrames.FormattingEnabled = true;
- this.drop_adaptBFrames.Items.AddRange(new object[] {
- "Default (Fast)",
- "Off",
- "Fast",
- "Optimal"});
- this.drop_adaptBFrames.Location = new System.Drawing.Point(417, 24);
- this.drop_adaptBFrames.Name = "drop_adaptBFrames";
- this.drop_adaptBFrames.Size = new System.Drawing.Size(106, 21);
- this.drop_adaptBFrames.TabIndex = 82;
- this.ToolTip.SetToolTip(this.drop_adaptBFrames, resources.GetString("drop_adaptBFrames.ToolTip"));
- this.drop_adaptBFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label43
- //
- this.label43.AutoSize = true;
- this.label43.BackColor = System.Drawing.Color.Transparent;
- this.label43.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label43.Location = new System.Drawing.Point(13, 13);
- this.label43.Name = "label43";
- this.label43.Size = new System.Drawing.Size(60, 13);
- this.label43.TabIndex = 49;
- this.label43.Text = "Encoding:";
- //
- // btn_reset
- //
- this.btn_reset.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btn_reset.ForeColor = System.Drawing.Color.DarkOrange;
- this.btn_reset.Location = new System.Drawing.Point(634, 230);
- this.btn_reset.Name = "btn_reset";
- this.btn_reset.Size = new System.Drawing.Size(75, 23);
- this.btn_reset.TabIndex = 79;
- this.btn_reset.Text = "Reset All";
- this.btn_reset.UseVisualStyleBackColor = true;
- this.btn_reset.Click += new System.EventHandler(this.btn_reset_Click);
- //
- // rtf_x264Query
- //
- this.rtf_x264Query.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.rtf_x264Query.Location = new System.Drawing.Point(16, 259);
- this.rtf_x264Query.Name = "rtf_x264Query";
- this.rtf_x264Query.Size = new System.Drawing.Size(698, 43);
- this.rtf_x264Query.TabIndex = 80;
- this.rtf_x264Query.Text = "";
- this.rtf_x264Query.TextChanged += new System.EventHandler(this.rtf_x264Query_TextChanged);
- //
- // check_Cabac
- //
- this.check_Cabac.AutoSize = true;
- this.check_Cabac.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.check_Cabac.Checked = true;
- this.check_Cabac.CheckState = System.Windows.Forms.CheckState.Checked;
- this.check_Cabac.Location = new System.Drawing.Point(3, 89);
- this.check_Cabac.Name = "check_Cabac";
- this.check_Cabac.RightToLeft = System.Windows.Forms.RightToLeft.No;
- this.check_Cabac.Size = new System.Drawing.Size(141, 17);
- this.check_Cabac.TabIndex = 78;
- this.check_Cabac.Text = "CABAC Entropy Coding:";
- this.check_Cabac.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.ToolTip.SetToolTip(this.check_Cabac, resources.GetString("check_Cabac.ToolTip"));
- this.check_Cabac.UseVisualStyleBackColor = true;
- this.check_Cabac.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // check_noDCTDecimate
- //
- this.check_noDCTDecimate.AutoSize = true;
- this.check_noDCTDecimate.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.check_noDCTDecimate.Location = new System.Drawing.Point(30, 212);
- this.check_noDCTDecimate.Name = "check_noDCTDecimate";
- this.check_noDCTDecimate.RightToLeft = System.Windows.Forms.RightToLeft.No;
- this.check_noDCTDecimate.Size = new System.Drawing.Size(114, 17);
- this.check_noDCTDecimate.TabIndex = 77;
- this.check_noDCTDecimate.Text = "No DCT-Decimate:";
- this.check_noDCTDecimate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.ToolTip.SetToolTip(this.check_noDCTDecimate, resources.GetString("check_noDCTDecimate.ToolTip"));
- this.check_noDCTDecimate.UseVisualStyleBackColor = true;
- this.check_noDCTDecimate.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_trellis
- //
- this.lbl_trellis.AutoSize = true;
- this.lbl_trellis.Location = new System.Drawing.Point(563, 43);
- this.lbl_trellis.Name = "lbl_trellis";
- this.lbl_trellis.Size = new System.Drawing.Size(38, 13);
- this.lbl_trellis.TabIndex = 67;
- this.lbl_trellis.Text = "Trellis:";
- //
- // drop_trellis
- //
- this.drop_trellis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_trellis.FormattingEnabled = true;
- this.drop_trellis.Items.AddRange(new object[] {
- "Default (Encode Only)",
- "Off",
- "Encode Only",
- "Always"});
- this.drop_trellis.Location = new System.Drawing.Point(615, 40);
- this.drop_trellis.Name = "drop_trellis";
- this.drop_trellis.Size = new System.Drawing.Size(94, 21);
- this.drop_trellis.TabIndex = 75;
- this.ToolTip.SetToolTip(this.drop_trellis, resources.GetString("drop_trellis.ToolTip"));
- this.drop_trellis.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // drop_deblockBeta
- //
- this.drop_deblockBeta.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_deblockBeta.FormattingEnabled = true;
- this.drop_deblockBeta.Items.AddRange(new object[] {
- "Default (0)",
- "-6",
- "-5",
- "-4",
- "-3",
- "-2",
- "-1",
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6"});
- this.drop_deblockBeta.Location = new System.Drawing.Point(631, 175);
- this.drop_deblockBeta.Name = "drop_deblockBeta";
- this.drop_deblockBeta.Size = new System.Drawing.Size(78, 21);
- this.drop_deblockBeta.TabIndex = 74;
- this.ToolTip.SetToolTip(this.drop_deblockBeta, resources.GetString("drop_deblockBeta.ToolTip"));
- this.drop_deblockBeta.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label41
- //
- this.label41.AutoSize = true;
- this.label41.Location = new System.Drawing.Point(563, 152);
- this.label41.Name = "label41";
- this.label41.Size = new System.Drawing.Size(62, 13);
- this.label41.TabIndex = 66;
- this.label41.Text = "Deblocking:";
- //
- // drop_deblockAlpha
- //
- this.drop_deblockAlpha.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_deblockAlpha.FormattingEnabled = true;
- this.drop_deblockAlpha.Items.AddRange(new object[] {
- "Default (0)",
- "-6",
- "-5",
- "-4",
- "-3",
- "-2",
- "-1",
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6"});
- this.drop_deblockAlpha.Location = new System.Drawing.Point(631, 149);
- this.drop_deblockAlpha.Name = "drop_deblockAlpha";
- this.drop_deblockAlpha.Size = new System.Drawing.Size(78, 21);
- this.drop_deblockAlpha.TabIndex = 73;
- this.ToolTip.SetToolTip(this.drop_deblockAlpha, resources.GetString("drop_deblockAlpha.ToolTip"));
- this.drop_deblockAlpha.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // check_8x8DCT
- //
- this.check_8x8DCT.AutoSize = true;
- this.check_8x8DCT.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.check_8x8DCT.Location = new System.Drawing.Point(44, 111);
- this.check_8x8DCT.Name = "check_8x8DCT";
- this.check_8x8DCT.RightToLeft = System.Windows.Forms.RightToLeft.No;
- this.check_8x8DCT.Size = new System.Drawing.Size(100, 17);
- this.check_8x8DCT.TabIndex = 72;
- this.check_8x8DCT.Text = "8x8 Transform:";
- this.check_8x8DCT.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.ToolTip.SetToolTip(this.check_8x8DCT, resources.GetString("check_8x8DCT.ToolTip"));
- this.check_8x8DCT.UseVisualStyleBackColor = true;
- this.check_8x8DCT.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label45
- //
- this.label45.AutoSize = true;
- this.label45.Location = new System.Drawing.Point(563, 16);
- this.label45.Name = "label45";
- this.label45.Size = new System.Drawing.Size(78, 13);
- this.label45.TabIndex = 64;
- this.label45.Text = "Partition Type:";
- //
- // drop_analysis
- //
- this.drop_analysis.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_analysis.FormattingEnabled = true;
- this.drop_analysis.Items.AddRange(new object[] {
- "Default (most)",
- "None",
- "Some",
- "All"});
- this.drop_analysis.Location = new System.Drawing.Point(646, 13);
- this.drop_analysis.Name = "drop_analysis";
- this.drop_analysis.Size = new System.Drawing.Size(63, 21);
- this.drop_analysis.TabIndex = 71;
- this.ToolTip.SetToolTip(this.drop_analysis, resources.GetString("drop_analysis.ToolTip"));
- this.drop_analysis.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label48
- //
- this.label48.AutoSize = true;
- this.label48.Location = new System.Drawing.Point(262, 110);
- this.label48.Name = "label48";
- this.label48.Size = new System.Drawing.Size(149, 13);
- this.label48.TabIndex = 62;
- this.label48.Text = "Subpixel ME && Mode Decision:";
- //
- // drop_subpixelMotionEstimation
- //
- this.drop_subpixelMotionEstimation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_subpixelMotionEstimation.FormattingEnabled = true;
- this.drop_subpixelMotionEstimation.Items.AddRange(new object[] {
- "Default (7)",
- "0: SAD, no subpel (super fast!)",
- "1: SAD, qpel",
- "2: SATD, qpel",
- "3: SATD, multi-qpel",
- "4: SATD, qpel on all",
- "5: SATD, multi-qpel on all",
- "6: RD in I/P-frames",
- "7: RD in all frames",
- "8: RD refine in I/P-frames",
- "9: RD refine in all frames",
- "10: QPRD in all frames",
- "11: No early terminations in analysis"});
- this.drop_subpixelMotionEstimation.Location = new System.Drawing.Point(417, 105);
- this.drop_subpixelMotionEstimation.Name = "drop_subpixelMotionEstimation";
- this.drop_subpixelMotionEstimation.Size = new System.Drawing.Size(139, 21);
- this.drop_subpixelMotionEstimation.TabIndex = 70;
- this.ToolTip.SetToolTip(this.drop_subpixelMotionEstimation, resources.GetString("drop_subpixelMotionEstimation.ToolTip"));
- this.drop_subpixelMotionEstimation.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_merange
- //
- this.lbl_merange.AutoSize = true;
- this.lbl_merange.Location = new System.Drawing.Point(282, 135);
- this.lbl_merange.Name = "lbl_merange";
- this.lbl_merange.Size = new System.Drawing.Size(129, 13);
- this.lbl_merange.TabIndex = 61;
- this.lbl_merange.Text = "Motion Estimation Range:";
- //
- // drop_MotionEstimationRange
- //
- this.drop_MotionEstimationRange.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_MotionEstimationRange.FormattingEnabled = true;
- this.drop_MotionEstimationRange.Items.AddRange(new object[] {
- "Default (16)",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "14",
- "15",
- "16",
- "17",
- "18",
- "19",
- "20",
- "21",
- "22",
- "23",
- "24",
- "25",
- "26",
- "27",
- "28",
- "29",
- "30",
- "31",
- "32",
- "33",
- "34",
- "35",
- "36",
- "37",
- "38",
- "39",
- "40",
- "41",
- "42",
- "43",
- "44",
- "45",
- "46",
- "47",
- "48",
- "49",
- "50",
- "51",
- "52",
- "53",
- "54",
- "55",
- "56",
- "57",
- "58",
- "59",
- "60",
- "61",
- "62",
- "63",
- "64"});
- this.drop_MotionEstimationRange.Location = new System.Drawing.Point(417, 132);
- this.drop_MotionEstimationRange.Name = "drop_MotionEstimationRange";
- this.drop_MotionEstimationRange.Size = new System.Drawing.Size(139, 21);
- this.drop_MotionEstimationRange.TabIndex = 69;
- this.ToolTip.SetToolTip(this.drop_MotionEstimationRange, resources.GetString("drop_MotionEstimationRange.ToolTip"));
- this.drop_MotionEstimationRange.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label54
- //
- this.label54.AutoSize = true;
- this.label54.Location = new System.Drawing.Point(277, 81);
- this.label54.Name = "label54";
- this.label54.Size = new System.Drawing.Size(134, 13);
- this.label54.TabIndex = 60;
- this.label54.Text = "Motion Estimation Method:";
- //
- // drop_MotionEstimationMethod
- //
- this.drop_MotionEstimationMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_MotionEstimationMethod.FormattingEnabled = true;
- this.drop_MotionEstimationMethod.ItemHeight = 13;
- this.drop_MotionEstimationMethod.Items.AddRange(new object[] {
- "Default (Hexagon)",
- "Diamond",
- "Hexagon",
- "Uneven Multi-Hexagon",
- "Exhaustive",
- "Transformed Exhaustive"});
- this.drop_MotionEstimationMethod.Location = new System.Drawing.Point(417, 78);
- this.drop_MotionEstimationMethod.Name = "drop_MotionEstimationMethod";
- this.drop_MotionEstimationMethod.Size = new System.Drawing.Size(139, 21);
- this.drop_MotionEstimationMethod.TabIndex = 68;
- this.ToolTip.SetToolTip(this.drop_MotionEstimationMethod, resources.GetString("drop_MotionEstimationMethod.ToolTip"));
- this.drop_MotionEstimationMethod.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_direct_prediction
- //
- this.lbl_direct_prediction.AutoSize = true;
- this.lbl_direct_prediction.Location = new System.Drawing.Point(297, 54);
- this.lbl_direct_prediction.Name = "lbl_direct_prediction";
- this.lbl_direct_prediction.Size = new System.Drawing.Size(114, 13);
- this.lbl_direct_prediction.TabIndex = 53;
- this.lbl_direct_prediction.Text = "Adaptive Direct Mode:";
- //
- // drop_directPrediction
- //
- this.drop_directPrediction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_directPrediction.FormattingEnabled = true;
- this.drop_directPrediction.Items.AddRange(new object[] {
- "Default (Spatial)",
- "None",
- "Spatial",
- "Temporal",
- "Automatic"});
- this.drop_directPrediction.Location = new System.Drawing.Point(417, 51);
- this.drop_directPrediction.Name = "drop_directPrediction";
- this.drop_directPrediction.Size = new System.Drawing.Size(106, 21);
- this.drop_directPrediction.TabIndex = 57;
- this.ToolTip.SetToolTip(this.drop_directPrediction, resources.GetString("drop_directPrediction.ToolTip"));
- this.drop_directPrediction.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label62
- //
- this.label62.AutoSize = true;
- this.label62.Location = new System.Drawing.Point(21, 64);
- this.label62.Name = "label62";
- this.label62.Size = new System.Drawing.Size(103, 13);
- this.label62.TabIndex = 52;
- this.label62.Text = "Maximum B-Frames:";
- //
- // drop_bFrames
- //
- this.drop_bFrames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_bFrames.FormattingEnabled = true;
- this.drop_bFrames.Items.AddRange(new object[] {
- "Default (3)",
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "14",
- "15",
- "16"});
- this.drop_bFrames.Location = new System.Drawing.Point(129, 61);
- this.drop_bFrames.Name = "drop_bFrames";
- this.drop_bFrames.Size = new System.Drawing.Size(106, 21);
- this.drop_bFrames.TabIndex = 56;
- this.ToolTip.SetToolTip(this.drop_bFrames, resources.GetString("drop_bFrames.ToolTip"));
- this.drop_bFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // label64
- //
- this.label64.AutoSize = true;
- this.label64.Location = new System.Drawing.Point(25, 38);
- this.label64.Name = "label64";
- this.label64.Size = new System.Drawing.Size(99, 13);
- this.label64.TabIndex = 50;
- this.label64.Text = "Reference Frames:";
- //
- // drop_refFrames
- //
- this.drop_refFrames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.drop_refFrames.FormattingEnabled = true;
- this.drop_refFrames.Items.AddRange(new object[] {
- "Default (3)",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "14",
- "15",
- "16"});
- this.drop_refFrames.Location = new System.Drawing.Point(129, 35);
- this.drop_refFrames.Name = "drop_refFrames";
- this.drop_refFrames.Size = new System.Drawing.Size(106, 21);
- this.drop_refFrames.TabIndex = 54;
- this.ToolTip.SetToolTip(this.drop_refFrames, resources.GetString("drop_refFrames.ToolTip"));
- this.drop_refFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // ToolTip
- //
- this.ToolTip.Active = false;
- this.ToolTip.AutomaticDelay = 1000;
- this.ToolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
- //
- // check_weightp
- //
- this.check_weightp.AutoSize = true;
- this.check_weightp.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
- this.check_weightp.ForeColor = System.Drawing.SystemColors.ControlText;
- this.check_weightp.Location = new System.Drawing.Point(20, 134);
- this.check_weightp.Name = "check_weightp";
- this.check_weightp.RightToLeft = System.Windows.Forms.RightToLeft.No;
- this.check_weightp.Size = new System.Drawing.Size(124, 17);
- this.check_weightp.TabIndex = 87;
- this.check_weightp.Text = "Weighted P-Frames:";
- this.ToolTip.SetToolTip(this.check_weightp, resources.GetString("check_weightp.ToolTip"));
- this.check_weightp.UseVisualStyleBackColor = true;
- this.check_weightp.CheckedChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // slider_adaptiveQuantStrength
- //
- this.slider_adaptiveQuantStrength.BackColor = System.Drawing.SystemColors.Window;
- this.slider_adaptiveQuantStrength.Location = new System.Drawing.Point(425, 167);
- this.slider_adaptiveQuantStrength.Maximum = 20;
- this.slider_adaptiveQuantStrength.Name = "slider_adaptiveQuantStrength";
- this.slider_adaptiveQuantStrength.Size = new System.Drawing.Size(131, 45);
- this.slider_adaptiveQuantStrength.TabIndex = 88;
- this.ToolTip.SetToolTip(this.slider_adaptiveQuantStrength, "Adaptive quantization controls how the encoder distributes bits across the frame." +
- " \r\nHigher values take more bits away from edges and complex areas to improve ar" +
- "eas with finer detail");
- this.slider_adaptiveQuantStrength.Value = 10;
- this.slider_adaptiveQuantStrength.Scroll += new System.EventHandler(this.widgetControlChanged);
- //
- // combo_pyrmidalBFrames
- //
- this.combo_pyrmidalBFrames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.combo_pyrmidalBFrames.FormattingEnabled = true;
- this.combo_pyrmidalBFrames.Items.AddRange(new object[] {
- "Default (Normal)",
- "Off",
- "Strict"});
- this.combo_pyrmidalBFrames.Location = new System.Drawing.Point(129, 157);
- this.combo_pyrmidalBFrames.Name = "combo_pyrmidalBFrames";
- this.combo_pyrmidalBFrames.Size = new System.Drawing.Size(106, 21);
- this.combo_pyrmidalBFrames.TabIndex = 92;
- this.ToolTip.SetToolTip(this.combo_pyrmidalBFrames, resources.GetString("combo_pyrmidalBFrames.ToolTip"));
- this.combo_pyrmidalBFrames.SelectedIndexChanged += new System.EventHandler(this.widgetControlChanged);
- //
- // lbl_adaptiveQuantStrength
- //
- this.lbl_adaptiveQuantStrength.AutoSize = true;
- this.lbl_adaptiveQuantStrength.Location = new System.Drawing.Point(248, 171);
- this.lbl_adaptiveQuantStrength.Name = "lbl_adaptiveQuantStrength";
- this.lbl_adaptiveQuantStrength.Size = new System.Drawing.Size(163, 13);
- this.lbl_adaptiveQuantStrength.TabIndex = 89;
- this.lbl_adaptiveQuantStrength.Text = "Adaptive Quantization Strength:";
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.BackColor = System.Drawing.Color.Transparent;
- this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label1.Location = new System.Drawing.Point(13, 193);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(83, 13);
- this.label1.TabIndex = 90;
- this.label1.Text = "Psychovisual:";
- //
- // lbl_prymidalBframes
- //
- this.lbl_prymidalBframes.AutoSize = true;
- this.lbl_prymidalBframes.Location = new System.Drawing.Point(20, 160);
- this.lbl_prymidalBframes.Name = "lbl_prymidalBframes";
- this.lbl_prymidalBframes.Size = new System.Drawing.Size(105, 13);
- this.lbl_prymidalBframes.TabIndex = 91;
- this.lbl_prymidalBframes.Text = "Pyramidal B-Frames:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.BackColor = System.Drawing.Color.Transparent;
- this.label3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label3.Location = new System.Drawing.Point(248, 13);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(57, 13);
- this.label3.TabIndex = 93;
- this.label3.Text = "Analysis:";
- //
- // x264Panel
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.Transparent;
- this.Controls.Add(this.rtf_x264Query);
- this.Controls.Add(this.slider_psytrellis);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.lbl_prymidalBframes);
- this.Controls.Add(this.combo_pyrmidalBFrames);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.slider_psyrd);
- this.Controls.Add(this.lbl_adaptiveQuantStrength);
- this.Controls.Add(this.slider_adaptiveQuantStrength);
- this.Controls.Add(this.check_weightp);
- this.Controls.Add(this.lbl_psytrellis);
- this.Controls.Add(this.lbl_psyrd);
- this.Controls.Add(this.lbl_adaptBFrames);
- this.Controls.Add(this.drop_adaptBFrames);
- this.Controls.Add(this.label43);
- this.Controls.Add(this.btn_reset);
- this.Controls.Add(this.check_Cabac);
- this.Controls.Add(this.check_noDCTDecimate);
- this.Controls.Add(this.lbl_trellis);
- this.Controls.Add(this.drop_trellis);
- this.Controls.Add(this.drop_deblockBeta);
- this.Controls.Add(this.label41);
- this.Controls.Add(this.drop_deblockAlpha);
- this.Controls.Add(this.check_8x8DCT);
- this.Controls.Add(this.label45);
- this.Controls.Add(this.drop_analysis);
- this.Controls.Add(this.label48);
- this.Controls.Add(this.drop_subpixelMotionEstimation);
- this.Controls.Add(this.lbl_merange);
- this.Controls.Add(this.drop_MotionEstimationRange);
- this.Controls.Add(this.label54);
- this.Controls.Add(this.drop_MotionEstimationMethod);
- this.Controls.Add(this.lbl_direct_prediction);
- this.Controls.Add(this.drop_directPrediction);
- this.Controls.Add(this.label62);
- this.Controls.Add(this.drop_bFrames);
- this.Controls.Add(this.label64);
- this.Controls.Add(this.drop_refFrames);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "x264Panel";
- this.Size = new System.Drawing.Size(720, 305);
- ((System.ComponentModel.ISupportInitialize)(this.slider_psytrellis)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.slider_psyrd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.slider_adaptiveQuantStrength)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- internal System.Windows.Forms.TrackBar slider_psytrellis;
- internal System.Windows.Forms.Label lbl_psytrellis;
- internal System.Windows.Forms.Label lbl_psyrd;
- internal System.Windows.Forms.TrackBar slider_psyrd;
- internal System.Windows.Forms.Label lbl_adaptBFrames;
- internal System.Windows.Forms.ComboBox drop_adaptBFrames;
- internal System.Windows.Forms.Label label43;
- internal System.Windows.Forms.Button btn_reset;
- internal System.Windows.Forms.RichTextBox rtf_x264Query;
- internal System.Windows.Forms.CheckBox check_Cabac;
- internal System.Windows.Forms.CheckBox check_noDCTDecimate;
- internal System.Windows.Forms.Label lbl_trellis;
- internal System.Windows.Forms.ComboBox drop_trellis;
- internal System.Windows.Forms.ComboBox drop_deblockBeta;
- internal System.Windows.Forms.Label label41;
- internal System.Windows.Forms.ComboBox drop_deblockAlpha;
- internal System.Windows.Forms.CheckBox check_8x8DCT;
- internal System.Windows.Forms.Label label45;
- internal System.Windows.Forms.ComboBox drop_analysis;
- internal System.Windows.Forms.Label label48;
- internal System.Windows.Forms.ComboBox drop_subpixelMotionEstimation;
- internal System.Windows.Forms.Label lbl_merange;
- internal System.Windows.Forms.ComboBox drop_MotionEstimationRange;
- internal System.Windows.Forms.Label label54;
- internal System.Windows.Forms.ComboBox drop_MotionEstimationMethod;
- internal System.Windows.Forms.Label lbl_direct_prediction;
- internal System.Windows.Forms.ComboBox drop_directPrediction;
- internal System.Windows.Forms.Label label62;
- internal System.Windows.Forms.ComboBox drop_bFrames;
- internal System.Windows.Forms.Label label64;
- internal System.Windows.Forms.ComboBox drop_refFrames;
- private System.Windows.Forms.ToolTip ToolTip;
- internal System.Windows.Forms.CheckBox check_weightp;
- internal System.Windows.Forms.Label lbl_adaptiveQuantStrength;
- internal System.Windows.Forms.TrackBar slider_adaptiveQuantStrength;
- internal System.Windows.Forms.Label label1;
- internal System.Windows.Forms.Label lbl_prymidalBframes;
- internal System.Windows.Forms.ComboBox combo_pyrmidalBFrames;
- internal System.Windows.Forms.Label label3;
- }
-}
diff --git a/win/CS/Controls/x264Panel.cs b/win/CS/Controls/x264Panel.cs
deleted file mode 100644
index aacb93983..000000000
--- a/win/CS/Controls/x264Panel.cs
+++ /dev/null
@@ -1,1082 +0,0 @@
-/* x264Panel.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. */
-
-namespace Handbrake.Controls
-{
- using System;
- using System.Globalization;
- using System.Windows.Forms;
-
- using HandBrake.ApplicationServices;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
- /// <summary>
- /// The x264 Panel
- /// </summary>
- public partial class x264Panel : UserControl
- {
- /*
- * TODO This code was ported from the obj-c MacGUI code. It's really messy and could really do with being cleaned up
- * at some point.
- */
-
- /// <summary>
- /// The User Setting Service.
- /// </summary>
- private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="x264Panel"/> class.
- /// Initializes a new instance of the x264 panel user control
- /// </summary>
- public x264Panel()
- {
- InitializeComponent();
-
- if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.TooltipEnable))
- ToolTip.Active = true;
-
- Reset2Defaults();
- }
-
- /// <summary>
- /// Gets or sets the X264 query string
- /// </summary>
- public string X264Query
- {
- get
- {
- return rtf_x264Query.Text;
- }
- set
- {
- rtf_x264Query.Text = value;
- }
- }
-
- /// <summary>
- /// Reset all components to defaults and clears the x264 rtf box
- /// </summary>
- public void Reset2Defaults()
- {
- check_8x8DCT.CheckState = CheckState.Checked;
- check_Cabac.CheckState = CheckState.Checked;
- check_weightp.CheckState = CheckState.Checked;
- check_noDCTDecimate.CheckState = CheckState.Unchecked;
- combo_pyrmidalBFrames.SelectedIndex = 0;
- drop_analysis.SelectedIndex = 0;
- drop_bFrames.SelectedIndex = 0;
- drop_deblockAlpha.SelectedIndex = 0;
- drop_deblockBeta.SelectedIndex = 0;
- drop_directPrediction.SelectedIndex = 0;
- drop_MotionEstimationMethod.SelectedIndex = 0;
- drop_MotionEstimationRange.SelectedIndex = 0;
- drop_refFrames.SelectedIndex = 0;
- drop_subpixelMotionEstimation.SelectedIndex = 0;
- drop_trellis.SelectedIndex = 0;
- slider_psyrd.Value = 10;
- slider_psytrellis.Value = 0;
- drop_adaptBFrames.SelectedIndex = 0;
- slider_adaptiveQuantStrength.Value = slider_adaptiveQuantStrength.Maximum / 2;
-
- rtf_x264Query.Text = string.Empty;
- }
-
- #region Standardize Option String
- /// <summary>
- /// Iterate over every x264 option, standardize it, write the full string to the x264 rtf box
- /// </summary>
- public void StandardizeOptString()
- {
- /* Set widgets depending on the opt string in field */
- string thisOpt; // The separated option such as "bframes=3"
- string optName; // The option name such as "bframes"
- string optValue; // The option value such as "3"
- string changedOptString = string.Empty;
- string[] currentOptsArray;
-
- /*First, we get an opt string to process */
- string currentOptString = rtf_x264Query.Text;
-
- /*verify there is an opt string to process */
- if (currentOptString.Contains("="))
- {
- /*Put individual options into an array based on the ":" separator for processing, result is "<opt>=<value>"*/
- currentOptsArray = currentOptString.Split(':');
-
- /*iterate through the array and get <opts> and <values*/
- int loopcounter;
- int currentOptsArrayCount = currentOptsArray.Length;
- for (loopcounter = 0; loopcounter < currentOptsArrayCount; loopcounter++)
- {
- thisOpt = currentOptsArray[loopcounter];
- if (currentOptsArray[currentOptsArrayCount - 1] == string.Empty)
- break;
-
- string[] splitOptRange = thisOpt.Split('=');
- if (thisOpt != string.Empty)
- {
- if (thisOpt.Contains("="))
- {
- optName = splitOptRange[0];
- optValue = splitOptRange[1];
-
- /* Standardize the names here depending on whats in the string */
- optName = StandardizeOptName(optName);
- thisOpt = optName + "=" + optValue;
- }
- else // No value given so we use a default of "1"
- {
- optName = thisOpt;
- /* Standardize the names here depending on whats in the string */
- optName = StandardizeOptName(optName);
- thisOpt = optName + "=1";
- }
- }
-
- /* Construct New String for opts here */
- if (thisOpt == string.Empty)
- changedOptString = changedOptString + thisOpt;
- else
- {
- if (changedOptString == string.Empty)
- changedOptString = thisOpt;
- else
- changedOptString = changedOptString + ":" + thisOpt;
- }
- }
- }
-
- /* Change the option string to reflect the new standardized option string */
- if (!string.IsNullOrEmpty(changedOptString) && !rtf_x264Query.Text.Equals(changedOptString))
- rtf_x264Query.Text = changedOptString;
- }
-
- /// <summary>
- /// Take a single option and standardize it. Returns as a String
- /// Input: String. - Single X264 Option. Name only
- /// Output: String - Single X264 Option. Name only. Changed to standard format
- /// </summary>
- /// <param name="cleanOptNameString">a string of x264 options to clean</param>
- /// <returns>A string containing standardized x264 option names</returns>
- private static string StandardizeOptName(string cleanOptNameString)
- {
- string input = cleanOptNameString;
-
- /* Reference Frames */
- if (input.Equals("ref") || input.Equals("frameref"))
- cleanOptNameString = "ref";
-
- /*No Dict Decimate*/
- if (input.Equals("no-dct-decimate") || input.Equals("no_dct_decimate") || input.Equals("nodct_decimate"))
- cleanOptNameString = "no-dct-decimate";
-
- /*Subme*/
- if (input.Equals("subme"))
- cleanOptNameString = "subq";
-
- /*ME Range*/
- if (input.Equals("me-range") || input.Equals("me_range"))
- cleanOptNameString = "merange";
-
- /*B Pyramid*/
- if (input.Equals("b_pyramid"))
- cleanOptNameString = "b-pyramid";
-
- /*Direct Prediction*/
- if (input.Equals("direct-pred") || input.Equals("direct_pred"))
- cleanOptNameString = "direct";
-
- /*Deblocking*/
- if (input.Equals("filter"))
- cleanOptNameString = "deblock";
-
- /*Analysis*/
- if (input.Equals("partitions"))
- cleanOptNameString = "analyse";
-
- return cleanOptNameString;
- }
- #endregion
-
- /// <summary>
- /// Resets the GUI widgets to the contents of the option string.
- /// </summary>
- public void SetCurrentSettingsInPanel()
- {
- /* Set widgets depending on the opt string in field */
- string thisOpt; // The separated option such as "bframes=3"
- string optName; // The option name such as "bframes"
- string optValue; // The option value such as "3"
- string[] currentOptsArray;
-
- // Set currentOptString to the contents of the text box.
- string currentOptString = rtf_x264Query.Text.Replace("\n", string.Empty);
-
- /*verify there is an opt string to process */
- if (currentOptString.Contains("="))
- {
- /*Put individual options into an array based on the ":" separator for processing, result is "<opt>=<value>"*/
- currentOptsArray = currentOptString.Split(':');
-
- /*iterate through the array and get <opts> and <values*/
- int loopcounter;
- int currentOptsArrayCount = currentOptsArray.Length;
-
- /*iterate through the array and get <opts> and <values*/
- for (loopcounter = 0; loopcounter < currentOptsArrayCount; loopcounter++)
- {
- thisOpt = currentOptsArray[loopcounter];
- string[] splitOptRange = thisOpt.Split('=');
-
- if (thisOpt.Contains("="))
- {
- optName = splitOptRange[0];
- optValue = splitOptRange[1];
-
- /*Run through the available widgets for x264 opts and set them, as you add widgets,
- they need to be added here. This should be moved to its own method probably*/
- switch (optName)
- {
- case "bframes":
- drop_bFrames.SelectedItem = optValue;
- continue;
- case "ref":
- drop_refFrames.SelectedItem = optValue;
- continue;
- case "weightp":
- this.check_weightp.CheckState = optValue == "0" ? CheckState.Unchecked : CheckState.Checked;
- continue;
- case "no-dct-decimate":
- check_noDCTDecimate.CheckState = CheckState.Checked;
- continue;
- case "subq":
- int subqValue;
- if (int.TryParse(optValue, out subqValue))
- {
- drop_subpixelMotionEstimation.SelectedIndex = subqValue + 1;
- }
- continue;
- case "trellis":
- switch (optValue)
- {
- case "0":
- drop_trellis.SelectedIndex = 1;
- break;
- case "1":
- drop_trellis.SelectedIndex = 2;
- break;
- case "2":
- drop_trellis.SelectedIndex = 3;
- break;
- }
- continue;
- case "me":
- if (optValue.Equals("dia"))
- drop_MotionEstimationMethod.SelectedItem = "Diamond";
- else if (optValue.Equals("hex"))
- drop_MotionEstimationMethod.SelectedItem = "Hexagon";
- else if (optValue.Equals("umh"))
- drop_MotionEstimationMethod.SelectedItem = "Uneven Multi-Hexagon";
- else if (optValue.Equals("esa"))
- drop_MotionEstimationMethod.SelectedItem = "Exhaustive";
- else if (optValue.Equals("tesa"))
- drop_MotionEstimationMethod.SelectedItem = "Transformed Exhaustive";
- continue;
- case "merange":
- drop_MotionEstimationRange.SelectedItem = optValue;
- continue;
- case "b-adapt":
- int badapt;
- int.TryParse(optValue, out badapt);
- drop_adaptBFrames.SelectedIndex = (badapt + 1);
- continue;
- case "b-pyramid":
- switch (optValue)
- {
- case "normal":
- combo_pyrmidalBFrames.SelectedIndex = 0;
- break;
- case "strict":
- combo_pyrmidalBFrames.SelectedIndex = 2;
- break;
- case "none":
- combo_pyrmidalBFrames.SelectedIndex = 1;
- break;
- }
- continue;
- case "direct":
- if (optValue == "auto")
- optValue = "Automatic";
-
- if (optValue != string.Empty)
- {
- char[] letters = optValue.ToCharArray();
- letters[0] = Char.ToUpper(letters[0]);
- optValue = new string(letters);
- }
-
- drop_directPrediction.SelectedItem = optValue;
- continue;
- case "deblock":
- string[] splitDeblock = optValue.Split(',');
- string alphaDeblock = splitDeblock[0];
- string betaDeblock = splitDeblock[1];
-
- if (alphaDeblock.Equals("0") && betaDeblock.Replace("\n", string.Empty).Equals("0"))
- {
- drop_deblockAlpha.SelectedItem = "Default (0)";
- drop_deblockBeta.SelectedItem = "Default (0)";
- }
- else
- {
- drop_deblockAlpha.SelectedItem = !alphaDeblock.Equals("0") ? alphaDeblock : "0";
-
- drop_deblockBeta.SelectedItem = !betaDeblock.Replace("\n", string.Empty).Equals("0")
- ? betaDeblock.Replace("\n", string.Empty)
- : "0";
- }
- continue;
- case "analyse":
- if (optValue.Equals("p8x8,b8x8,i8x8,i4x4"))
- drop_analysis.SelectedItem = "Default (most)";
- if (optValue.Equals("none"))
- drop_analysis.SelectedItem = "None";
- if (optValue.Equals("i4x4,i8x8"))
- drop_analysis.SelectedItem = "Some";
- if (optValue.Equals("all"))
- drop_analysis.SelectedItem = "All";
- continue;
- case "8x8dct":
- check_8x8DCT.CheckState = optValue == "1" ? CheckState.Checked : CheckState.Unchecked;
- continue;
- case "aq-strength":
- float value;
- float.TryParse(optValue, NumberStyles.Float, CultureInfo.InvariantCulture, out value);
- int sliderValue;
- int.TryParse((value * 10).ToString(), out sliderValue);
- slider_adaptiveQuantStrength.Value = sliderValue;
- continue;
- case "cabac":
- check_Cabac.CheckState = CheckState.Unchecked;
- continue;
- case "psy-rd":
- string[] x = optValue.Split(',');
-
- double psyrd, psytrellis;
- int val, val2;
-
- // default psy-rd = 1 (10 for the slider)
- psyrd = double.TryParse(x[0], NumberStyles.Float, CultureInfo.InvariantCulture, out psyrd) ? psyrd * 10 : 10.0;
- // default psy-trellis = 0
- psytrellis = double.TryParse(x[1], NumberStyles.Float, CultureInfo.InvariantCulture, out psytrellis) ? psytrellis * 20 : 0.0;
-
- int.TryParse(psyrd.ToString(), out val);
- int.TryParse(psytrellis.ToString(), out val2);
-
- slider_psyrd.Value = val;
- slider_psytrellis.Value = val2;
- continue;
- }
- }
- }
- }
- }
-
- /// <summary>
- /// This function will update the X264 Query when one of the GUI widgets changes.
- /// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- private void OnX264WidgetChange(string sender)
- {
- Animate(sender);
- string optNameToChange = sender;
- string currentOptString = rtf_x264Query.Text;
-
- /*First, we create a pattern to check for ":"optNameToChange"=" to modify the option if the name falls after
- the first character of the opt string (hence the ":") */
- string checkOptNameToChange = ":" + optNameToChange + "=";
- string checkOptNameToChangeBegin = optNameToChange + "=";
-
- // IF the current H264 Option String Contains Multiple Items or Just 1 Item
- if ((currentOptString.Contains(checkOptNameToChange)) || (currentOptString.StartsWith(checkOptNameToChangeBegin)))
- HasOptions(currentOptString, optNameToChange);
- else // IF there is no options in the rich text box!
- HasNoOptions(optNameToChange);
- }
-
- /// <summary>
- /// Called when the current x264 option string contains multiple (or a single) item(s) in it seperated by :
- /// it updates the current option that the widget corrosponds to, if it is already in thes string.
- /// </summary>
- /// <param name="currentOptString">The Current Option String</param>
- /// <param name="optNameToChange">Name of the option to change</param>
- private void HasOptions(string currentOptString, string optNameToChange)
- {
- string thisOpt; // The separated option such as "bframes=3"
- string optName; // The option name such as "bframes"
- string[] currentOptsArray;
-
- /* Create new empty opt string*/
- string changedOptString = string.Empty;
-
- /*Put individual options into an array based on the ":" separator for processing, result is "<opt>=<value>"*/
- currentOptsArray = currentOptString.Split(':');
-
- /*iterate through the array and get <opts> and <values*/
- for (int loopcounter = 0; loopcounter < currentOptsArray.Length; loopcounter++)
- {
- thisOpt = currentOptsArray[loopcounter];
-
- if (thisOpt.Contains("="))
- {
- string[] splitOptRange = thisOpt.Split('=');
-
- optName = splitOptRange[0]; // e.g bframes
-
- /*
- * Run through the available widgets for x264 opts and set them, as you add widgets,
- * they need to be added here. This should be moved to its own method probably
- * If the optNameToChange is found, appropriately change the value or delete it if
- * "unspecified" is set.
- */
- if (optName.Equals(optNameToChange))
- {
- if (optNameToChange.Equals("deblock"))
- {
- string da = drop_deblockAlpha.SelectedItem.ToString();
- string db = drop_deblockBeta.SelectedItem.ToString();
-
- if (((da.Contains("Default")) && (db.Contains("Default"))) ||
- ((da.Contains("0")) && (db.Contains("0"))))
- {
- drop_deblockBeta.SelectedItem = "Default (0)";
- drop_deblockAlpha.SelectedItem = "Default (0)";
- thisOpt = string.Empty;
- }
- else if ((!da.Contains("Default")) && (db.Contains("Default")))
- {
- drop_deblockBeta.SelectedItem = "0";
- thisOpt = "deblock=" + da + ",0";
- }
- else if ((da.Contains("Default")) && (!db.Contains("Default")))
- {
- drop_deblockAlpha.SelectedItem = "0";
- thisOpt = "deblock=0," + db;
- }
- else if ((!da.Contains("Default")) && (!db.Contains("Default")))
- thisOpt = "deblock=" + da + "," + db;
- }
- else if (optNameToChange.Equals("aq-strength"))
- {
- if (slider_adaptiveQuantStrength.Value == 10)
- thisOpt = string.Empty;
- else
- {
- double value = slider_adaptiveQuantStrength.Value * 0.1;
- string aqs = value.ToString("f1", CultureInfo.InvariantCulture);
- thisOpt = "aq-strength=" + aqs;
- }
- }
- else if (optNameToChange.Equals("psy-rd"))
- {
- if (slider_psyrd.Value == 10 && slider_psytrellis.Value == 0)
- thisOpt = string.Empty;
- else
- {
- double psyrd = slider_psyrd.Value * 0.1;
- double psytre = slider_psytrellis.Value * 0.05;
-
- string rd = psyrd.ToString("f2", CultureInfo.InvariantCulture);
- string rt = psytre.ToString("f2", CultureInfo.InvariantCulture);
-
- thisOpt = "psy-rd=" + rd + "," + rt;
- }
- }
- else if (optNameToChange.Equals("b-pyramid"))
- {
- switch (combo_pyrmidalBFrames.SelectedIndex)
- {
- case 0: // Default
- thisOpt = string.Empty;
- break;
- case 1: // Off
- thisOpt = "b-pyramid=none";
- break;
- case 2: // Strict
- thisOpt = "b-pyramid=strict";
- break;
- }
- }
- else if (optNameToChange.Equals("no-dct-decimate"))
- thisOpt = check_noDCTDecimate.CheckState == CheckState.Checked ? "no-dct-decimate=1" : string.Empty;
- else if (optNameToChange.Equals("8x8dct"))
- thisOpt = check_8x8DCT.CheckState == CheckState.Unchecked ? "8x8dct=0" : string.Empty;
- else if (optNameToChange.Equals("cabac"))
- thisOpt = check_Cabac.CheckState == CheckState.Checked ? string.Empty : "cabac=0";
- else if (optNameToChange.Equals("weightp"))
- thisOpt = check_weightp.CheckState == CheckState.Checked ? string.Empty : "weightp=0";
- else if (optNameToChange.Equals("me"))
- {
- switch (drop_MotionEstimationMethod.SelectedIndex)
- {
- case 1:
- thisOpt = "me=dia";
- break;
-
- case 2:
- thisOpt = "me=hex";
- break;
-
- case 3:
- thisOpt = "me=umh";
- break;
-
- case 4:
- thisOpt = "me=esa";
- break;
-
- case 5:
- thisOpt = "me=tesa";
- break;
-
- default:
- thisOpt = string.Empty;
- break;
- }
- }
- else if (optNameToChange.Equals("direct"))
- {
- switch (drop_directPrediction.SelectedIndex)
- {
- case 1:
- thisOpt = "direct=none";
- break;
-
- case 2:
- thisOpt = "direct=spatial";
- break;
-
- case 3:
- thisOpt = "direct=temporal";
- break;
-
- case 4:
- thisOpt = "direct=auto";
- break;
-
- default:
- thisOpt = string.Empty;
- break;
- }
- }
- else if (optNameToChange.Equals("analyse"))
- {
- switch (drop_analysis.SelectedIndex)
- {
- case 1:
- thisOpt = "analyse=none";
- break;
-
- case 2:
- thisOpt = "analyse=i4x4,i8x8";
- break;
-
- case 3:
- thisOpt = "analyse=all";
- break;
-
- default:
- thisOpt = string.Empty;
- break;
- }
- }
- else if (optNameToChange.Equals("merange"))
- {
- thisOpt = !drop_MotionEstimationRange.SelectedItem.ToString().Contains("Default")
- ? "merange=" + drop_MotionEstimationRange.SelectedItem
- : string.Empty;
- }
- else if (optNameToChange.Equals("b-adapt"))
- {
- thisOpt = !drop_adaptBFrames.SelectedItem.ToString().Contains("Default")
- ? "b-adapt=" + (drop_adaptBFrames.SelectedIndex - 1)
- : string.Empty;
- }
- else if (optNameToChange.Equals("ref"))
- {
- thisOpt = !drop_refFrames.SelectedItem.ToString().Contains("Default")
- ? "ref=" + drop_refFrames.SelectedItem
- : string.Empty;
- }
- else if (optNameToChange.Equals("bframes"))
- {
- string value = drop_bFrames.SelectedItem.ToString();
- thisOpt = !drop_bFrames.SelectedItem.ToString().Contains("Default")
- ? "bframes=" + value
- : string.Empty;
- }
- else if (optNameToChange.Equals("subq"))
- {
- string value = drop_subpixelMotionEstimation.SelectedItem.ToString();
- string[] val = value.Split(':');
- thisOpt = !drop_subpixelMotionEstimation.SelectedItem.ToString().Contains("Default")
- ? "subq=" + val[0]
- : string.Empty;
- }
- else if (optNameToChange.Equals("trellis"))
- {
- switch (drop_trellis.SelectedIndex)
- {
- case 1: // Off
- thisOpt = "trellis=0";
- break;
- case 2: // Encode Only
- thisOpt = "trellis=1";
- break;
- case 3: // Always
- thisOpt = "trellis=2";
- break;
- default:
- thisOpt = string.Empty;
- break;
- }
- }
- }
- }
-
- /* Construct New String for opts here */
- if (!thisOpt.Equals(string.Empty))
- changedOptString = changedOptString.Equals(string.Empty) ? thisOpt : changedOptString + ":" + thisOpt;
- }
-
- /* Change the option string to reflect the new mod settings */
- rtf_x264Query.Text = changedOptString;
- }
-
- /// <summary>
- /// Add's an option to the x264 query string.
- /// Handles 2 cases. 1 Where rtf_x264Query.Text is empty, and one where there is an option with no value,
- /// e.g no-fast-pskip
- /// </summary>
- /// <param name="optNameToChange">The Option Name to Change</param>
- private void HasNoOptions(IEquatable<string> optNameToChange)
- {
- string colon = string.Empty;
- if (rtf_x264Query.Text != string.Empty)
- colon = ":";
-
- string query = rtf_x264Query.Text;
- if (optNameToChange.Equals("me"))
- {
- switch (drop_MotionEstimationMethod.SelectedIndex)
- {
- case 1:
- query = query + colon + "me=dia";
- break;
-
- case 2:
- query = query + colon + "me=hex";
- break;
-
- case 3:
- query = query + colon + "me=umh";
- break;
-
- case 4:
- query = query + colon + "me=esa";
- break;
-
- case 5:
- query = query + colon + "me=tesa";
- break;
-
- default:
- break;
- }
- }
- else if (optNameToChange.Equals("direct"))
- {
- switch (drop_directPrediction.SelectedIndex)
- {
- case 1:
- query = query + colon + "direct=none";
- break;
-
- case 2:
- query = query + colon + "direct=spatial";
- break;
-
- case 3:
- query = query + colon + "direct=temporal";
- break;
-
- case 4:
- query = query + colon + "direct=auto";
- break;
-
- default:
- break;
- }
- }
- else if (optNameToChange.Equals("analyse"))
- {
- switch (drop_analysis.SelectedIndex)
- {
- case 1:
- query = query + colon + "analyse=none";
- break;
-
- case 2:
- query = query + colon + "analyse=i4x4,i8x8";
- break;
-
- case 3:
- query = query + colon + "analyse=all";
- break;
-
- default:
- break;
- }
- }
- else if (optNameToChange.Equals("merange"))
- {
- int value = drop_MotionEstimationRange.SelectedIndex + 3;
- query = query + colon + "merange=" + value;
- }
- else if (optNameToChange.Equals("b-adapt"))
- {
- int value = drop_adaptBFrames.SelectedIndex - 1;
- query = query + colon + "b-adapt=" + value;
- }
- else if (optNameToChange.Equals("deblock"))
- {
- string da = drop_deblockAlpha.SelectedItem.ToString();
- string db = drop_deblockBeta.Text;
-
- if (((da.Contains("Default")) && (db.Contains("Default"))) || ((da.Contains("0")) && (db.Contains("0"))))
- {
- drop_deblockBeta.SelectedItem = "Default (0)";
- drop_deblockAlpha.SelectedItem = "Default (0)";
- }
- else
- {
- if (db.Contains("Default"))
- db = "0";
-
- if (da.Contains("Default"))
- da = "0";
-
- query = query + colon + "deblock=" + da + "," + db;
- }
- }
- else if (optNameToChange.Equals("aq-strength"))
- {
- if (slider_adaptiveQuantStrength.Value == 10)
- query = string.Empty;
- else
- {
- double value = slider_adaptiveQuantStrength.Value * 0.1;
- string aqs = value.ToString("f1", CultureInfo.InvariantCulture);
- query += colon + "aq-strength=" + aqs;
- }
- }
- else if (optNameToChange.Equals("psy-rd"))
- {
- if (slider_psyrd.Value == 10 && slider_psytrellis.Value == 0)
- query += string.Empty;
- else
- {
- double psyrd = slider_psyrd.Value * 0.1;
- double psytre = slider_psytrellis.Value * 0.05;
-
- string rd = psyrd.ToString("f1", CultureInfo.InvariantCulture);
- string rt = psytre.ToString("f2", CultureInfo.InvariantCulture);
-
- query += colon + "psy-rd=" + rd + "," + rt;
- }
- }
- else if (optNameToChange.Equals("b-pyramid"))
- {
- switch (combo_pyrmidalBFrames.SelectedIndex)
- {
- case 0:
- break;
- case 1:
- query = query + colon + "b-pyramid=none";
- break;
- case 2:
- query = query + colon + "b-pyramid=strict";
- break;
- }
- }
- else if (optNameToChange.Equals("no-dct-decimate"))
- {
- if (check_noDCTDecimate.CheckState == CheckState.Checked)
- query = query + colon + "no-dct-decimate=1";
- }
- else if (optNameToChange.Equals("8x8dct"))
- {
- if (check_8x8DCT.CheckState == CheckState.Unchecked)
- query = query + colon + "8x8dct=0";
- }
- else if (optNameToChange.Equals("cabac"))
- {
- if (check_Cabac.CheckState != CheckState.Checked)
- query = query + colon + "cabac=0";
- }
- else if (optNameToChange.Equals("weightp"))
- {
- if (check_weightp.CheckState == CheckState.Unchecked)
- query = query + colon + "weightp=0";
- }
- else if (optNameToChange.Equals("ref"))
- {
- if (!drop_refFrames.SelectedItem.ToString().Contains("Default"))
- query = query + colon + "ref=" + drop_refFrames.SelectedItem;
- }
- else if (optNameToChange.Equals("bframes"))
- {
- string value = drop_bFrames.SelectedItem.ToString();
- if (!drop_bFrames.SelectedItem.ToString().Contains("Default"))
- query = query + colon + "bframes=" + value;
- }
- else if (optNameToChange.Equals("subq"))
- {
- string value = drop_subpixelMotionEstimation.SelectedItem.ToString();
- if (!drop_subpixelMotionEstimation.SelectedItem.ToString().Contains("Default"))
- {
- string[] val = value.Split(':');
- query = query + colon + "subq=" + val[0];
- }
- }
- else if (optNameToChange.Equals("trellis"))
- {
- switch (drop_trellis.SelectedIndex)
- {
- case 1: // Off
- query = query + colon + "trellis=0";
- break;
- case 2: // Encode Only
- query = query + colon + "trellis=1";
- break;
- case 3: // Always
- query = query + colon + "trellis=2";
- break;
- default:
- break;
- }
- }
-
- rtf_x264Query.Text = query;
- }
-
- /// <summary>
- /// Shows and hides controls based on the values of other controls.
- /// </summary>
- /// <param name="sender">The Sender</param>
- private void Animate(string sender)
- {
- /* Lots of situations to cover.
- - B-frames (when 0 turn of b-frame specific stuff, when < 2 disable b-pyramid)
- - CABAC (when 0 turn off trellis and psy-trel
- - subme (if under 6, turn off psy-rd and psy-trel)
- - trellis (if 0, turn off psy-trel)
- */
-
- switch (sender)
- {
- case "bframes":
- if (drop_bFrames.SelectedIndex == 1)
- {
- /* If the b-frame widget is at 1, the user has chosen
- not to use b-frames at all. So disable the options
- that can only be used when b-frames are enabled. */
- combo_pyrmidalBFrames.Visible = false;
- lbl_prymidalBframes.Visible = false;
- drop_directPrediction.Visible = false;
- lbl_direct_prediction.Visible = false;
-
- combo_pyrmidalBFrames.SelectedIndex = 0;
- drop_directPrediction.SelectedIndex = 0;
-
- drop_adaptBFrames.Visible = false;
- lbl_adaptBFrames.Visible = false;
- drop_adaptBFrames.SelectedIndex = 0;
- }
- else if (drop_bFrames.SelectedIndex == 2)
- {
- /* Only 1 b-frame? Disable b-pyramid. */
- combo_pyrmidalBFrames.Visible = false;
- lbl_prymidalBframes.Visible = false;
- combo_pyrmidalBFrames.SelectedIndex = 0;
-
- drop_directPrediction.Visible = true;
- lbl_direct_prediction.Visible = true;
-
- drop_adaptBFrames.Visible = true;
- lbl_adaptBFrames.Visible = true;
- }
- else
- {
- combo_pyrmidalBFrames.Visible = true;
- lbl_prymidalBframes.Visible = true;
- drop_directPrediction.Visible = true;
- lbl_direct_prediction.Visible = true;
-
- drop_adaptBFrames.Visible = true;
- lbl_adaptBFrames.Visible = true;
- }
- break;
- case "me": // Motion Estimation
- if (drop_MotionEstimationMethod.SelectedIndex < 3)
- {
- drop_MotionEstimationRange.Visible = false;
- lbl_merange.Visible = false;
- drop_MotionEstimationRange.SelectedIndex = 0;
- }
- else
- {
- drop_MotionEstimationRange.Visible = true;
- lbl_merange.Visible = true;
- }
- break;
- case "subq": // subme
- if (drop_subpixelMotionEstimation.SelectedIndex != 0 &&
- drop_subpixelMotionEstimation.SelectedIndex < 7)
- {
- slider_psyrd.Visible = false;
- slider_psyrd.Value = 10;
- lbl_psyrd.Visible = false;
-
- slider_psytrellis.Visible = false;
- slider_psytrellis.Value = 0;
- lbl_psytrellis.Visible = false;
- }
- else
- {
- slider_psyrd.Visible = true;
- lbl_psyrd.Visible = true;
-
- if (drop_trellis.SelectedIndex >= 2 && slider_psytrellis.Visible == false)
- {
- slider_psytrellis.Visible = true;
- lbl_psytrellis.Visible = true;
- }
- }
- break;
- case "trellis": // subme
- if (drop_trellis.SelectedIndex > 0 && drop_trellis.SelectedIndex < 2)
- {
- slider_psytrellis.Visible = false;
- slider_psytrellis.Value = 0;
- lbl_psytrellis.Visible = false;
- }
- else
- {
- if ((drop_subpixelMotionEstimation.SelectedIndex == 0 || drop_subpixelMotionEstimation.SelectedIndex >= 7) && slider_psytrellis.Visible == false)
- {
- slider_psytrellis.Visible = true;
- lbl_psytrellis.Visible = true;
- }
- }
- break;
- }
- }
-
- /* UI Events */
-
- private void widgetControlChanged(object sender, EventArgs e)
- {
- Control changedControlName = (Control) sender;
- string controlName = string.Empty;
-
- switch (changedControlName.Name.Trim())
- {
- case "drop_refFrames":
- controlName = "ref";
- break;
- case "drop_bFrames":
- controlName = "bframes";
- break;
- case "drop_directPrediction":
- controlName = "direct";
- break;
- case "check_weightp":
- controlName = "weightp";
- break;
- case "combo_pyrmidalBFrames":
- controlName = "b-pyramid";
- break;
- case "drop_MotionEstimationMethod":
- controlName = "me";
- break;
- case "drop_MotionEstimationRange":
- controlName = "merange";
- break;
- case "drop_subpixelMotionEstimation":
- controlName = "subq";
- break;
- case "drop_analysis":
- controlName = "analyse";
- break;
- case "check_8x8DCT":
- controlName = "8x8dct";
- break;
- case "drop_deblockAlpha":
- controlName = "deblock";
- break;
- case "drop_deblockBeta":
- controlName = "deblock";
- break;
- case "drop_trellis":
- controlName = "trellis";
- break;
- case "check_noDCTDecimate":
- controlName = "no-dct-decimate";
- break;
- case "check_Cabac":
- controlName = "cabac";
- break;
- case "slider_psyrd":
- controlName = "psy-rd";
- break;
- case "slider_psytrellis":
- controlName = "psy-rd";
- break;
- case "slider_adaptiveQuantStrength":
- controlName = "aq-strength";
- break;
- case "drop_adaptBFrames":
- controlName = "b-adapt";
- break;
- }
- OnX264WidgetChange(controlName);
- }
-
- private void rtf_x264Query_TextChanged(object sender, EventArgs e)
- {
- if (rtf_x264Query.Text.EndsWith("\n"))
- {
- string query = rtf_x264Query.Text.Replace("\n", string.Empty);
- Reset2Defaults();
- rtf_x264Query.Text = query;
- this.StandardizeOptString();
- this.SetCurrentSettingsInPanel();
-
- if (rtf_x264Query.Text == string.Empty)
- Reset2Defaults();
- }
- }
-
- private void btn_reset_Click(object sender, EventArgs e)
- {
- rtf_x264Query.Text = string.Empty;
- Reset2Defaults();
- }
- }
-} \ No newline at end of file
diff --git a/win/CS/Controls/x264Panel.resx b/win/CS/Controls/x264Panel.resx
deleted file mode 100644
index 41e3ec5c7..000000000
--- a/win/CS/Controls/x264Panel.resx
+++ /dev/null
@@ -1,241 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <data name="slider_psyrd.ToolTip" xml:space="preserve">
- <value>Psychovisual Rate Distortion Optimization sure is a mouthful, isn't it? Basically, it means x264 tries to retain detail, for better quality to the human eye,
-as opposed to trying to maximize quality the way a computer understands it, through signal-to-noise ratios that have trouble telling apart fine detail and noise.</value>
- </data>
- <data name="drop_adaptBFrames.ToolTip" xml:space="preserve">
- <value>x264 has a variety of algorithms to decide when to use B-frames and how many to use.
-
-Fast mode takes roughly the same amount of time no matter how many B-frames you specify. However, while fast, its decisions are often suboptimal.
-
-Optimal mode gets slower as the maximum number of B-Frames increases, but makes much more accurate decisions, especially when used with B-pyramid.</value>
- </data>
- <data name="check_Cabac.ToolTip" xml:space="preserve">
- <value>After the encoder has done its work, it has a bunch of data that needs to be compressed losslessly, similar to ZIP or RAR.
-H.264 provides two options for this: CAVLC and CABAC. CABAC decodes a lot slower but compresses significantly better (10-30%), especially at lower bitrates.
-If you're looking to minimize CPU requirements for video playback, disable this option.
-Baseline profile, as required for iPods and similar devices, requires CABAC to be disabled.</value>
- </data>
- <data name="check_noDCTDecimate.ToolTip" xml:space="preserve">
- <value>x264 normally zeroes out nearly-empty data blocks to save bits to be better used for some other purpose in the video.
-However, this can sometimes have slight negative effects on retention of subtle grain and dither.
-Don't touch this unless you're having banding issues or other such cases where you are having trouble keeping fine noise.</value>
- </data>
- <data name="drop_trellis.ToolTip" xml:space="preserve">
- <value>Trellis fine-tunes the rounding of transform coefficients to squeeze out 3-5% more compression at the cost of some speed.
-"Always" uses trellis not only during the main encoding process, but also during analysis, which improves compression even
-more, albeit at great speed cost.
-
-Trellis costs more speed at higher bitrates</value>
- </data>
- <data name="drop_deblockBeta.ToolTip" xml:space="preserve">
- <value>H.264 has a built-in deblocking filter that smooths out blocking artifacts after decoding each frame. This not only improves visual quality, but also helps compression significantly.
-The deblocking filter takes a lot of CPU power, so if you're looking to minimize CPU requirements for video playback, disable it.
-
-The deblocking filter has two adjustable parameters, \"strength\" and \"threshold\".
-The former controls how strong (or weak) the deblocker is, while the latter controls how many (or few) edges it applies to.
-Lower values mean less deblocking, higher values mean more deblocking. The default is 0 (normal strength) for both parameters.</value>
- </data>
- <data name="drop_deblockAlpha.ToolTip" xml:space="preserve">
- <value>H.264 has a built-in deblocking filter that smooths out blocking artifacts after decoding each frame. This not only improves visual quality, but also helps compression significantly.
-The deblocking filter takes a lot of CPU power, so if you're looking to minimize CPU requirements for video playback, disable it.
-
-The deblocking filter has two adjustable parameters, \"strength\" and \"threshold\".
-The former controls how strong (or weak) the deblocker is, while the latter controls how many (or few) edges it applies to.
-Lower values mean less deblocking, higher values mean more deblocking. The default is 0 (normal strength) for both parameters.</value>
- </data>
- <data name="check_8x8DCT.ToolTip" xml:space="preserve">
- <value>The 8x8 transform is the single most useful feature of x264 in terms of compression-per-speed.
-It improves compression by at least 5% at a very small speed cost and may provide an unusually high visual quality benefit compared to its compression gain.
-However, it requires High Profile, which many devices may not support.</value>
- </data>
- <data name="drop_analysis.ToolTip" xml:space="preserve">
- <value>Mode decision picks from a variety of options to make its decision: this option chooses what options those are.
-Fewer partitions to check means faster encoding, at the cost of worse decisions, since the best option might have been one that was turned off.</value>
- </data>
- <data name="drop_subpixelMotionEstimation.ToolTip" xml:space="preserve">
- <value>This setting controls both subpixel-precision motion estimation and mode decision methods.
-
-Subpixel motion estimation is used for refining motion estimates beyond mere pixel accuracy, improving compression.
-
-Mode decision is the method used to choose how to encode each block of the frame: a very important decision.
-
-SAD is the fastest method, followed by SATD, RD, RD refinement, and the slowest, QPRD.
-6 or higher is strongly recommended: Psy-RD, a very powerful psy optimization that helps retain detail, requires RD.
-10, the most powerful and slowest option, requires trellis=2.</value>
- </data>
- <data name="drop_MotionEstimationRange.ToolTip" xml:space="preserve">
- <value>This is the distance x264 searches from its best guess at the motion of a block in order to try to find its actual motion.
-Doesn't apply to Diamond or Hexagon search options.
-The default is fine for most content, but extremely high motion video, especially at HD resolutions, may benefit from higher ranges, albeit at a high speed cost.</value>
- </data>
- <data name="drop_MotionEstimationMethod.ToolTip" xml:space="preserve">
- <value>Controls the motion estimation method. Motion estimation is how the encoder estimates how each block of pixels in a frame has moved.
-A better motion search method improves compression at the cost of speed.
-
-Diamond: performs an extremely fast and simple search using a diamond pattern.
-
-Hexagon: performs a somewhat more effective but slightly slower search using a hexagon pattern.
-
-Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex motion.
-
-Exhaustive: performs a \"dumb\" search of every pixel in a wide area. Significantly slower for only a small compression gain.
-
-Transformed Exhaustive: Like exhaustive, but makes even more accurate decisions. Accordingly, somewhat slower, also for only a small improvement.</value>
- </data>
- <data name="drop_directPrediction.ToolTip" xml:space="preserve">
- <value>H.264 allows for two different prediction modes, spatial and temporal, in B-frames.
-
-Spatial, the default, is almost always better, but temporal is sometimes useful too.
-
-x264 can, at the cost of a small amount of speed (and accordingly for a small compression gain), adaptively select which is better for each particular frame.</value>
- </data>
- <data name="drop_bFrames.ToolTip" xml:space="preserve">
- <value>Sane values are ~2-5.
-This specifies the maximum number of sequential B-frames that the encoder can use.
- Large numbers generally won't help significantly unless Adaptive B-frames is set to Optimal.
-Cel-animated source material and B-pyramid also significantly increase the usefulness of larger values.
-Baseline profile, as required for iPods and similar devices, requires B-frames to be set to 0 (off).</value>
- </data>
- <data name="drop_refFrames.ToolTip" xml:space="preserve">
- <value>Sane values are ~1-6.
-The more you add, the better the compression, but the slower the encode.
-Cel animation tends to benefit from more reference frames a lot more than film content.
-Note that many hardware devices have limitations on the number of supported reference frames, so if you're encoding for a handheld or standalone player,
-don't touch this unless you're absolutely sure you know what you're doing!</value>
- </data>
- <data name="check_weightp.ToolTip" xml:space="preserve">
- <value>Performs extra analysis to decide upon weighting parameters for each frame.
-This improves overall compression slightly and improves the quality of fades greatly.
-Baseline profile, as required for iPods and similar devices, requires weighted P-frame prediction to be disabled.
-Note that some devices and players, even those that support Main Profile,
-may have problems with Weighted P-frame prediction: the Apple TV is completely incompatible with it, for example.</value>
- </data>
- <data name="combo_pyrmidalBFrames.ToolTip" xml:space="preserve">
- <value>B-pyramid improves compression by creating a pyramidal structure (hence the name) of B-frames, allowing B-frames to
-reference each other to improve compression.
-
-Requires Max B-frames greater than 1; optimal adaptive B-frames is strongly recommended for full compression benefit.</value>
- </data>
-</root> \ No newline at end of file