summaryrefslogtreecommitdiffstats
path: root/win/CS/ToolWindows/AdvancedAudio.cs
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/AdvancedAudio.cs
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/AdvancedAudio.cs')
-rw-r--r--win/CS/ToolWindows/AdvancedAudio.cs40
1 files changed, 40 insertions, 0 deletions
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;
+ }
}
}