summaryrefslogtreecommitdiffstats
path: root/win/CS/ToolWindows
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-04-16 15:21:42 +0000
committersr55 <[email protected]>2011-04-16 15:21:42 +0000
commit680ed831fb94849f57565665ed4f467f2d3283e5 (patch)
tree784b72fd4521cf5fc21b097a406d56051f5cd5c5 /win/CS/ToolWindows
parenta05f96f954d41c88f91b1a254f8fa6982cb0e86b (diff)
WinGui:
- Moved DRC onto the advanced audio panel and tweaked the UI slightly. - Updated to Stylecop 4.5 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3934 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/ToolWindows')
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.Designer.cs70
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.cs40
2 files changed, 99 insertions, 11 deletions
diff --git a/win/CS/ToolWindows/AdvancedAudio.Designer.cs b/win/CS/ToolWindows/AdvancedAudio.Designer.cs
index aac2bd574..41e28429a 100644
--- a/win/CS/ToolWindows/AdvancedAudio.Designer.cs
+++ b/win/CS/ToolWindows/AdvancedAudio.Designer.cs
@@ -33,24 +33,29 @@
this.gainTrackBar = new System.Windows.Forms.TrackBar();
this.lbl_GainValue = new System.Windows.Forms.Label();
this.btn_close = new System.Windows.Forms.Button();
+ this.label2 = new System.Windows.Forms.Label();
+ this.lbl_drc = new System.Windows.Forms.Label();
+ this.tb_drc = new System.Windows.Forms.TrackBar();
((System.ComponentModel.ISupportInitialize)(this.gainTrackBar)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.tb_drc)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(12, 22);
+ 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(12, 9);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(54, 13);
+ this.label1.Size = new System.Drawing.Size(97, 13);
this.label1.TabIndex = 1;
- this.label1.Text = "Gain (dB):";
+ this.label1.Text = "Audio Gain (dB):";
//
// gainTrackBar
//
- this.gainTrackBar.Location = new System.Drawing.Point(72, 12);
+ this.gainTrackBar.Location = new System.Drawing.Point(12, 25);
this.gainTrackBar.Maximum = 41;
this.gainTrackBar.Name = "gainTrackBar";
- this.gainTrackBar.Size = new System.Drawing.Size(171, 45);
+ this.gainTrackBar.Size = new System.Drawing.Size(231, 45);
this.gainTrackBar.TabIndex = 2;
this.gainTrackBar.Value = 21;
this.gainTrackBar.Scroll += new System.EventHandler(this.gainTrackBar_Scroll);
@@ -58,18 +63,19 @@
// lbl_GainValue
//
this.lbl_GainValue.AutoSize = true;
- this.lbl_GainValue.Location = new System.Drawing.Point(249, 22);
+ this.lbl_GainValue.Location = new System.Drawing.Point(249, 31);
this.lbl_GainValue.Name = "lbl_GainValue";
- this.lbl_GainValue.Size = new System.Drawing.Size(29, 13);
+ this.lbl_GainValue.Size = new System.Drawing.Size(28, 13);
this.lbl_GainValue.TabIndex = 3;
this.lbl_GainValue.Text = "0 dB";
//
// btn_close
//
+ this.btn_close.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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.Location = new System.Drawing.Point(207, 133);
this.btn_close.Name = "btn_close";
this.btn_close.Size = new System.Drawing.Size(71, 22);
this.btn_close.TabIndex = 5;
@@ -78,25 +84,64 @@
this.btn_close.UseVisualStyleBackColor = true;
this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
//
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label2.Location = new System.Drawing.Point(12, 69);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(98, 13);
+ this.label2.TabIndex = 6;
+ this.label2.Text = "Dynamic Range:";
+ //
+ // lbl_drc
+ //
+ this.lbl_drc.AutoSize = true;
+ this.lbl_drc.Location = new System.Drawing.Point(249, 95);
+ this.lbl_drc.Name = "lbl_drc";
+ this.lbl_drc.Size = new System.Drawing.Size(13, 13);
+ this.lbl_drc.TabIndex = 8;
+ this.lbl_drc.Text = "0";
+ //
+ // tb_drc
+ //
+ this.tb_drc.LargeChange = 0;
+ this.tb_drc.Location = new System.Drawing.Point(15, 89);
+ this.tb_drc.Margin = new System.Windows.Forms.Padding(0);
+ this.tb_drc.Maximum = 31;
+ this.tb_drc.Name = "tb_drc";
+ this.tb_drc.Size = new System.Drawing.Size(228, 45);
+ this.tb_drc.TabIndex = 61;
+ this.tb_drc.Scroll += new System.EventHandler(this.tb_drc_Scroll);
+ //
// 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.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.ClientSize = new System.Drawing.Size(289, 164);
+ this.Controls.Add(this.tb_drc);
+ this.Controls.Add(this.lbl_drc);
+ this.Controls.Add(this.label2);
this.Controls.Add(this.btn_close);
this.Controls.Add(this.lbl_GainValue);
this.Controls.Add(this.gainTrackBar);
this.Controls.Add(this.label1);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+ this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AdvancedAudio";
+ this.Opacity = 0.95D;
this.ShowIcon = false;
+ this.ShowInTaskbar = 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();
+ ((System.ComponentModel.ISupportInitialize)(this.tb_drc)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -108,5 +153,8 @@
private System.Windows.Forms.TrackBar gainTrackBar;
private System.Windows.Forms.Label lbl_GainValue;
internal System.Windows.Forms.Button btn_close;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label lbl_drc;
+ internal System.Windows.Forms.TrackBar tb_drc;
}
} \ No newline at end of file
diff --git a/win/CS/ToolWindows/AdvancedAudio.cs b/win/CS/ToolWindows/AdvancedAudio.cs
index 616d40f70..5adc7c49e 100644
--- a/win/CS/ToolWindows/AdvancedAudio.cs
+++ b/win/CS/ToolWindows/AdvancedAudio.cs
@@ -6,6 +6,7 @@
namespace Handbrake.ToolWindows
{
using System;
+ using System.Globalization;
using System.Windows.Forms;
using HandBrake.ApplicationServices.Model.Encoding;
@@ -15,6 +16,12 @@ namespace Handbrake.ToolWindows
/// </summary>
public partial class AdvancedAudio : Form
{
+ // Culture Info
+ private static readonly CultureInfo Culture = new CultureInfo("en-US", false);
+
+ /// <summary>
+ /// The Advanced Audio Panel
+ /// </summary>
public AdvancedAudio()
{
InitializeComponent();
@@ -55,6 +62,15 @@ namespace Handbrake.ToolWindows
}
lbl_GainValue.Text = string.Format("{0} dB", track.Gain);
+
+ // Set the DRC Control
+ double drcValue = 0;
+ int drcCalculated;
+ if (track.DRC != 0)
+ drcValue = ((track.DRC * 10) + 1) - 10;
+ int.TryParse(drcValue.ToString(Culture), out drcCalculated);
+ tb_drc.Value = drcCalculated;
+ lbl_drc.Text = track.DRC.ToString();
}
}
@@ -93,6 +109,14 @@ namespace Handbrake.ToolWindows
lbl_GainValue.Text = string.Format("{0} dB", gain);
+ // Figure out the DRC Value
+ double drcValue = 0;
+ int drcCalculated;
+ if (track.DRC != 0)
+ drcValue = ((track.DRC * 10) + 1) - 10;
+ int.TryParse(drcValue.ToString(Culture), out drcCalculated);
+ tb_drc.Value = drcCalculated;
+
// Set the model.
if (this.track == null)
{
@@ -100,5 +124,21 @@ namespace Handbrake.ToolWindows
}
this.Track.Gain = gain;
}
+
+ /// <summary>
+ /// The Dynamic Range Controller
+ /// </summary>
+ /// <param name="sender">The Sender</param>
+ /// <param name="e">The Event Args</param>
+ private void tb_drc_Scroll(object sender, EventArgs e)
+ {
+ double value;
+ if (tb_drc.Value == 0) value = 0;
+ else
+ value = ((tb_drc.Value - 1) / 10.0) + 1;
+
+ lbl_drc.Text = value.ToString();
+ track.DRC = value;
+ }
}
}