summaryrefslogtreecommitdiffstats
path: root/win/CS/ToolWindows
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-04-15 21:04:18 +0000
committersr55 <[email protected]>2011-04-15 21:04:18 +0000
commita264b3c24c8ef687cac5325753be29f1b0f1d9f9 (patch)
tree318e69fb9ad0af00d2a2ae36c7b03d7f2d14c9af /win/CS/ToolWindows
parent70fee546acaf4db3efb690ac4aaa09e0f4cb65e8 (diff)
WinGui:
- Added "Advanced" audio options floating popup window. * This exposes a new Audio Gain Control (-20 to +20 dB) - Added support for (--gain=x,y,z) to the preset Loader. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3929 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/ToolWindows')
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.Designer.cs112
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.cs104
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.resx (renamed from win/CS/ToolWindows/PreviewOverlay.resx)6
-rw-r--r--win/CS/ToolWindows/PreviewOverlay.Designer.cs143
-rw-r--r--win/CS/ToolWindows/PreviewOverlay.cs59
5 files changed, 219 insertions, 205 deletions
diff --git a/win/CS/ToolWindows/AdvancedAudio.Designer.cs b/win/CS/ToolWindows/AdvancedAudio.Designer.cs
new file mode 100644
index 000000000..aac2bd574
--- /dev/null
+++ b/win/CS/ToolWindows/AdvancedAudio.Designer.cs
@@ -0,0 +1,112 @@
+namespace Handbrake.ToolWindows
+{
+ partial class AdvancedAudio
+ {
+ /// <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 Windows Form 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()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvancedAudio));
+ this.label1 = new System.Windows.Forms.Label();
+ this.gainTrackBar = new System.Windows.Forms.TrackBar();
+ this.lbl_GainValue = new System.Windows.Forms.Label();
+ this.btn_close = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.gainTrackBar)).BeginInit();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 22);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(54, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Gain (dB):";
+ //
+ // gainTrackBar
+ //
+ this.gainTrackBar.Location = new System.Drawing.Point(72, 12);
+ this.gainTrackBar.Maximum = 41;
+ this.gainTrackBar.Name = "gainTrackBar";
+ this.gainTrackBar.Size = new System.Drawing.Size(171, 45);
+ this.gainTrackBar.TabIndex = 2;
+ this.gainTrackBar.Value = 21;
+ this.gainTrackBar.Scroll += new System.EventHandler(this.gainTrackBar_Scroll);
+ //
+ // lbl_GainValue
+ //
+ this.lbl_GainValue.AutoSize = true;
+ this.lbl_GainValue.Location = new System.Drawing.Point(249, 22);
+ this.lbl_GainValue.Name = "lbl_GainValue";
+ this.lbl_GainValue.Size = new System.Drawing.Size(29, 13);
+ this.lbl_GainValue.TabIndex = 3;
+ this.lbl_GainValue.Text = "0 dB";
+ //
+ // btn_close
+ //
+ this.btn_close.FlatAppearance.BorderColor = System.Drawing.Color.Black;
+ this.btn_close.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
+ this.btn_close.Location = new System.Drawing.Point(207, 52);
+ this.btn_close.Name = "btn_close";
+ this.btn_close.Size = new System.Drawing.Size(71, 22);
+ this.btn_close.TabIndex = 5;
+ this.btn_close.TabStop = false;
+ this.btn_close.Text = "Close";
+ this.btn_close.UseVisualStyleBackColor = true;
+ this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
+ //
+ // AdvancedAudio
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(295, 83);
+ this.Controls.Add(this.btn_close);
+ this.Controls.Add(this.lbl_GainValue);
+ this.Controls.Add(this.gainTrackBar);
+ this.Controls.Add(this.label1);
+ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "AdvancedAudio";
+ this.ShowIcon = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Advanced Audio";
+ this.TopMost = true;
+ ((System.ComponentModel.ISupportInitialize)(this.gainTrackBar)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TrackBar gainTrackBar;
+ private System.Windows.Forms.Label lbl_GainValue;
+ internal System.Windows.Forms.Button btn_close;
+ }
+} \ No newline at end of file
diff --git a/win/CS/ToolWindows/AdvancedAudio.cs b/win/CS/ToolWindows/AdvancedAudio.cs
new file mode 100644
index 000000000..616d40f70
--- /dev/null
+++ b/win/CS/ToolWindows/AdvancedAudio.cs
@@ -0,0 +1,104 @@
+/* Advanced Audio.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.ToolWindows
+{
+ using System;
+ using System.Windows.Forms;
+
+ using HandBrake.ApplicationServices.Model.Encoding;
+
+ /// <summary>
+ /// Advanced Audio Panel
+ /// </summary>
+ public partial class AdvancedAudio : Form
+ {
+ public AdvancedAudio()
+ {
+ InitializeComponent();
+ }
+
+ private AudioTrack track;
+
+ /// <summary>
+ /// Gets or sets the Audio Track to alter.
+ /// </summary>
+ public AudioTrack Track
+ {
+ get
+ {
+ return this.track;
+ }
+ set
+ {
+ this.track = value;
+
+ if (this.track == null)
+ {
+ return;
+ }
+
+ // Set the Gain Control.
+ if (track.Gain == 0)
+ {
+ gainTrackBar.Value = 21; // The centre point
+ }
+ else if (track.Gain > 0)
+ {
+ gainTrackBar.Value = 21 + track.Gain;
+ }
+ else if (track.Gain < 0)
+ {
+ gainTrackBar.Value = 20 - Math.Abs(track.Gain);
+ }
+
+ lbl_GainValue.Text = string.Format("{0} dB", track.Gain);
+ }
+ }
+
+ /// <summary>
+ /// Close the window
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The Event Args</param>
+ private void btn_close_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.OK;
+ this.Close();
+ }
+
+ /// <summary>
+ /// Set the Gain value for the audio track.
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The Event Arg</param>
+ private void gainTrackBar_Scroll(object sender, EventArgs e)
+ {
+ // Figure out the Gain.
+ int gain = 0;
+ if (gainTrackBar.Value == 21)
+ {
+ gain = 0;
+ }
+ else if (gainTrackBar.Value > 21)
+ {
+ gain = gainTrackBar.Value - 21;
+ }
+ else if (gainTrackBar.Value < 21)
+ {
+ gain = (-20 + gainTrackBar.Value);
+ }
+
+ lbl_GainValue.Text = string.Format("{0} dB", gain);
+
+ // Set the model.
+ if (this.track == null)
+ {
+ return;
+ }
+ this.Track.Gain = gain;
+ }
+ }
+}
diff --git a/win/CS/ToolWindows/PreviewOverlay.resx b/win/CS/ToolWindows/AdvancedAudio.resx
index ff217dc4f..c3c3ff8ef 100644
--- a/win/CS/ToolWindows/PreviewOverlay.resx
+++ b/win/CS/ToolWindows/AdvancedAudio.resx
@@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA
diff --git a/win/CS/ToolWindows/PreviewOverlay.Designer.cs b/win/CS/ToolWindows/PreviewOverlay.Designer.cs
deleted file mode 100644
index 0ce54f82a..000000000
--- a/win/CS/ToolWindows/PreviewOverlay.Designer.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-namespace Handbrake.ToolWindows
-{
- partial class PreviewOverlay
- {
- /// <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 Windows Form 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()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreviewOverlay));
- this.PlayWithQT = new System.Windows.Forms.Button();
- this.progressBar1 = new System.Windows.Forms.ProgressBar();
- this.drp_preview = new System.Windows.Forms.ComboBox();
- this.drp_duration = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // PlayWithQT
- //
- this.PlayWithQT.FlatAppearance.BorderColor = System.Drawing.Color.Black;
- this.PlayWithQT.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.PlayWithQT.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
- this.PlayWithQT.Location = new System.Drawing.Point(347, 45);
- this.PlayWithQT.Name = "PlayWithQT";
- this.PlayWithQT.Size = new System.Drawing.Size(90, 22);
- this.PlayWithQT.TabIndex = 4;
- this.PlayWithQT.TabStop = false;
- this.PlayWithQT.Text = "Play";
- this.PlayWithQT.UseVisualStyleBackColor = true;
- this.PlayWithQT.Click += new System.EventHandler(this.PlayWithQtClick);
- //
- // progressBar1
- //
- this.progressBar1.Location = new System.Drawing.Point(12, 12);
- this.progressBar1.Name = "progressBar1";
- this.progressBar1.Size = new System.Drawing.Size(425, 10);
- this.progressBar1.TabIndex = 6;
- //
- // drp_preview
- //
- this.drp_preview.FormattingEnabled = true;
- this.drp_preview.Location = new System.Drawing.Point(63, 47);
- this.drp_preview.Name = "drp_preview";
- this.drp_preview.Size = new System.Drawing.Size(56, 21);
- this.drp_preview.TabIndex = 7;
- //
- // drp_duration
- //
- this.drp_duration.FormattingEnabled = true;
- this.drp_duration.Location = new System.Drawing.Point(195, 47);
- this.drp_duration.Name = "drp_duration";
- this.drp_duration.Size = new System.Drawing.Size(73, 21);
- this.drp_duration.TabIndex = 8;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(125, 50);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(64, 13);
- this.label1.TabIndex = 9;
- this.label1.Text = "Duration (s):";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(12, 50);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(48, 13);
- this.label2.TabIndex = 10;
- this.label2.Text = "Preview:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(12, 25);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(140, 13);
- this.label3.TabIndex = 11;
- this.label3.Text = "Select a frame and duration:";
- //
- // PreviewOverlay
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(453, 80);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.drp_duration);
- this.Controls.Add(this.drp_preview);
- this.Controls.Add(this.progressBar1);
- this.Controls.Add(this.PlayWithQT);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "PreviewOverlay";
- this.Opacity = 0.75D;
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Title Scan";
- this.TopMost = true;
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- internal System.Windows.Forms.Button PlayWithQT;
- private System.Windows.Forms.ProgressBar progressBar1;
- private System.Windows.Forms.ComboBox drp_preview;
- private System.Windows.Forms.ComboBox drp_duration;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label3;
- }
-} \ No newline at end of file
diff --git a/win/CS/ToolWindows/PreviewOverlay.cs b/win/CS/ToolWindows/PreviewOverlay.cs
deleted file mode 100644
index fda971664..000000000
--- a/win/CS/ToolWindows/PreviewOverlay.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/* TitleSpecificScan.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.ToolWindows
-{
- using System;
- using System.Windows.Forms;
-
- /// <summary>
- /// Title Specific Scan
- /// </summary>
- public partial class PreviewOverlay : Form
- {
- public PreviewOverlay()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// Gets the preview frame that the user entered.
- /// </summary>
- public int Preview
- {
- get
- {
- int value;
- int.TryParse(drp_preview.SelectedItem.ToString(), out value);
-
- return value;
- }
- }
-
- /// <summary>
- /// Gets the duration that the user entered.
- /// </summary>
- public int Duration
- {
- get
- {
- int value;
- int.TryParse(drp_preview.SelectedItem.ToString(), out value);
-
- return value;
- }
- }
-
- /// <summary>
- /// Play the video with Quicktime
- /// </summary>
- /// <param name="sender">The Sender</param>
- /// <param name="e">The EventArgs</param>
- private void PlayWithQtClick(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.OK;
- }
- }
-} \ No newline at end of file