summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/Controls/AudioPanel.Designer.cs172
-rw-r--r--win/CS/Controls/AudioPanel.cs22
-rw-r--r--win/CS/Controls/AudioPanel.resx13
-rw-r--r--win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs25
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs8
-rw-r--r--win/CS/HandBrakeCS.csproj18
-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
13 files changed, 411 insertions, 294 deletions
diff --git a/win/CS/Controls/AudioPanel.Designer.cs b/win/CS/Controls/AudioPanel.Designer.cs
index fef5ae9b3..dd6dc768e 100644
--- a/win/CS/Controls/AudioPanel.Designer.cs
+++ b/win/CS/Controls/AudioPanel.Designer.cs
@@ -54,14 +54,16 @@ namespace Handbrake.Controls
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
this.label1 = new System.Windows.Forms.Label();
this.lbl_audioTrack = new System.Windows.Forms.Label();
- this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.audioList = new System.Windows.Forms.DataGridView();
this.ToolTips = new System.Windows.Forms.ToolTip(this.components);
+ this.btn_AdvancedAudio = new System.Windows.Forms.Button();
+ 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.audioMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tb_drc)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.audioList)).BeginInit();
@@ -281,66 +283,6 @@ namespace Handbrake.Controls
this.lbl_audioTrack.TabIndex = 69;
this.lbl_audioTrack.Text = "None";
//
- // 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;
- //
- // 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;
- //
- // 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;
- //
- // Mixdown
- //
- this.Mixdown.DataPropertyName = "Mixdown";
- 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;
- //
- // AudioCodec
- //
- this.AudioCodec.DataPropertyName = "Encoder";
- 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;
- //
- // Source
- //
- this.Source.DataPropertyName = "SourceTrack";
- 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;
- //
// audioList
//
this.audioList.AllowUserToAddRows = false;
@@ -355,7 +297,8 @@ namespace Handbrake.Controls
this.Mixdown,
this.Samplerate,
this.Bitrate,
- this.DRC});
+ this.DRC,
+ this.Gain});
this.audioList.ContextMenuStrip = this.audioMenu;
this.audioList.GridColor = System.Drawing.Color.White;
this.audioList.Location = new System.Drawing.Point(16, 114);
@@ -373,10 +316,91 @@ namespace Handbrake.Controls
this.ToolTips.SetToolTip(this.audioList, "The audio tracks to be encoded into the output file.");
this.audioList.SelectionChanged += new System.EventHandler(this.audioList_SelectionChanged);
//
+ // btn_AdvancedAudio
+ //
+ this.btn_AdvancedAudio.BackColor = System.Drawing.Color.Transparent;
+ 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(630, 38);
+ this.btn_AdvancedAudio.Name = "btn_AdvancedAudio";
+ this.btn_AdvancedAudio.Size = new System.Drawing.Size(71, 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);
+ //
+ // Source
+ //
+ this.Source.DataPropertyName = "SourceTrack";
+ 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 = "Encoder";
+ 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 = "Mixdown";
+ 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.Width = 60;
+ //
// AudioPanel
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.btn_AdvancedAudio);
this.Controls.Add(this.label1);
this.Controls.Add(this.lbl_audioTrack);
this.Controls.Add(this.drp_audioTrack);
@@ -421,13 +445,15 @@ namespace Handbrake.Controls
internal System.Windows.Forms.ComboBox drp_audioBitrate;
internal System.Windows.Forms.Label label1;
internal System.Windows.Forms.Label lbl_audioTrack;
- private System.Windows.Forms.DataGridViewTextBoxColumn DRC;
- private System.Windows.Forms.DataGridViewTextBoxColumn Bitrate;
- private System.Windows.Forms.DataGridViewTextBoxColumn Samplerate;
- private System.Windows.Forms.DataGridViewTextBoxColumn Mixdown;
- private System.Windows.Forms.DataGridViewTextBoxColumn AudioCodec;
- private System.Windows.Forms.DataGridViewTextBoxColumn Source;
private System.Windows.Forms.DataGridView audioList;
private System.Windows.Forms.ToolTip ToolTips;
+ private System.Windows.Forms.Button btn_AdvancedAudio;
+ 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;
}
}
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index d569a1f6a..ddd75d703 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -18,6 +18,8 @@ namespace Handbrake.Controls
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Utilities;
+ using Handbrake.ToolWindows;
+
using AudioTrack = HandBrake.ApplicationServices.Model.Encoding.AudioTrack;
/// <summary>
@@ -33,6 +35,7 @@ namespace Handbrake.Controls
private static readonly CultureInfo Culture = new CultureInfo("en-US", false);
private const string AC3Passthru = "AC3 Passthru";
private const string DTSPassthru = "DTS Passthru";
+ AdvancedAudio advancedAudio = new AdvancedAudio();
private readonly BindingList<AudioTrack> audioTracks = new BindingList<AudioTrack>();
@@ -50,6 +53,8 @@ namespace Handbrake.Controls
drp_audioMix.SelectedItem = "Dolby Pro Logic II";
drp_audioSample.SelectedIndex = 1;
+
+
}
/// <summary>
@@ -307,10 +312,15 @@ namespace Handbrake.Controls
lbl_drc.Text = track.DRC.ToString();
lbl_audioTrack.Text = track.SourceTrack;
+
+ // Set the Advanced Control.
+ if (!advancedAudio.IsDisposed)
+ advancedAudio.Track = track;
}
}
else
lbl_audioTrack.Text = "(Click \"Add Track\" to add)";
+
}
#endregion
@@ -691,5 +701,17 @@ namespace Handbrake.Controls
}
#endregion
+
+ private void btn_AdvancedAudio_Click(object sender, EventArgs e)
+ {
+ if (advancedAudio.IsDisposed)
+ {
+ advancedAudio = new AdvancedAudio { Track = this.audioList.SelectedRows[0].DataBoundItem as AudioTrack };
+ }
+
+ advancedAudio.Show();
+ }
+
+
}
} \ No newline at end of file
diff --git a/win/CS/Controls/AudioPanel.resx b/win/CS/Controls/AudioPanel.resx
index 053c14c9d..483d3e97c 100644
--- a/win/CS/Controls/AudioPanel.resx
+++ b/win/CS/Controls/AudioPanel.resx
@@ -134,22 +134,25 @@ sections softer and soft sections louder</value>
<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="DRC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <metadata name="Source.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">
+ <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="Mixdown.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <metadata name="Bitrate.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">
+ <metadata name="DRC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
- <metadata name="Source.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <metadata name="Gain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index 48a1eb08a..7f4592241 100644
--- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -116,6 +116,7 @@
<Compile Include="Model\Encoding\VideoEncodeRateMode.cs" />
<Compile Include="Model\General\UpdateCheckInformation.cs" />
<Compile Include="Model\General\UpdateCheckResult.cs" />
+ <Compile Include="Model\ModelBase.cs" />
<Compile Include="Model\Preset.cs" />
<Compile Include="Model\QueueTask.cs" />
<Compile Include="Model\Encoding\SubtitleType.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 6e47d3421..a6db51572 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -8,8 +8,15 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// An Audio Track for the Audio Panel
/// </summary>
- public class AudioTrack
+ public class AudioTrack : ModelBase
{
+ #region Private Variables
+ /// <summary>
+ /// The gain value
+ /// </summary>
+ private int gain;
+ #endregion
+
/// <summary>
/// Initializes a new instance of the <see cref="AudioTrack"/> class.
/// </summary>
@@ -97,6 +104,20 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// Gets or sets the Gain for the audio track
/// </summary>
- public int Gain { get; set; }
+ public int Gain
+ {
+ get
+ {
+ return this.gain;
+ }
+ set
+ {
+ if (!object.Equals(value, this.gain))
+ {
+ this.gain = value;
+ this.OnPropertyChanged("Gain");
+ }
+ }
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs b/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs
new file mode 100644
index 000000000..041b18eb3
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs
@@ -0,0 +1,22 @@
+/* ModelBase.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.ApplicationServices.Model
+{
+ using System.ComponentModel;
+
+ public class ModelBase : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ if (null != PropertyChanged)
+ {
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index 4d34ac937..62de5d6d6 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -98,6 +98,7 @@ namespace HandBrake.ApplicationServices.Utilities
Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]*)"); // Auto = a-z
Match audioSampleRates = Regex.Match(input, @"-R ([0-9a-zA-Z.,]*)"); // Auto = a-z
Match drcValues = Regex.Match(input, @"-D ([0-9.,]*)");
+ Match gainValues = Regex.Match(input, @"--gain=([0-9.,-]*)");
// Chapters Tab
Match chapterMarkers = Regex.Match(input, @" -m");
@@ -338,6 +339,7 @@ namespace HandBrake.ApplicationServices.Utilities
string[] trackBitrates = null;
string[] trackSamplerates = null;
string[] trackDRCvalues = null;
+ string[] trackGainValues = null;
if (audioTracks.Success)
trackData = audioTracks.ToString().Replace("-a ", string.Empty).Split(',');
@@ -351,6 +353,8 @@ namespace HandBrake.ApplicationServices.Utilities
trackSamplerates = audioSampleRates.ToString().Replace("-R ", string.Empty).Split(',');
if (drcValues.Success)
trackDRCvalues = drcValues.ToString().Replace("-D ", string.Empty).Split(',');
+ if (gainValues.Success)
+ trackGainValues = gainValues.ToString().Replace("--gain=", string.Empty).Split(',');
// Create new Audio Track Classes and store them in the ArrayList
List<AudioTrack> allAudioTrackInfo = new List<AudioTrack>();
@@ -381,6 +385,10 @@ namespace HandBrake.ApplicationServices.Utilities
if (trackDRCvalues.Length >= (x + 1)) // Audio DRC Values
track.DRC = double.Parse(trackDRCvalues[x].Trim(), Culture);
+ if (trackGainValues != null)
+ if (trackGainValues.Length >= (x + 1)) // Audio DRC Values
+ track.Gain = int.Parse(trackGainValues[x].Trim());
+
allAudioTrackInfo.Add(track);
}
diff --git a/win/CS/HandBrakeCS.csproj b/win/CS/HandBrakeCS.csproj
index 358ef6662..dec9da341 100644
--- a/win/CS/HandBrakeCS.csproj
+++ b/win/CS/HandBrakeCS.csproj
@@ -262,6 +262,12 @@
</Compile>
<Compile Include="Model\SourceType.cs" />
<Compile Include="Program.cs" />
+ <Compile Include="ToolWindows\AdvancedAudio.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="ToolWindows\AdvancedAudio.Designer.cs">
+ <DependentUpon>AdvancedAudio.cs</DependentUpon>
+ </Compile>
<Compile Include="ToolWindows\BatchAdd.cs">
<SubType>Form</SubType>
</Compile>
@@ -280,12 +286,6 @@
<Compile Include="ToolWindows\ExceptionWindow.designer.cs">
<DependentUpon>ExceptionWindow.cs</DependentUpon>
</Compile>
- <Compile Include="ToolWindows\PreviewOverlay.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="ToolWindows\PreviewOverlay.Designer.cs">
- <DependentUpon>PreviewOverlay.cs</DependentUpon>
- </Compile>
<Compile Include="ToolWindows\TitleSpecificScan.cs">
<SubType>Form</SubType>
</Compile>
@@ -360,6 +360,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
+ <EmbeddedResource Include="ToolWindows\AdvancedAudio.resx">
+ <DependentUpon>AdvancedAudio.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="ToolWindows\BatchAdd.resx">
<DependentUpon>BatchAdd.cs</DependentUpon>
</EmbeddedResource>
@@ -370,9 +373,6 @@
<EmbeddedResource Include="ToolWindows\ExceptionWindow.resx">
<DependentUpon>ExceptionWindow.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ToolWindows\PreviewOverlay.resx">
- <DependentUpon>PreviewOverlay.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="ToolWindows\TitleSpecificScan.resx">
<DependentUpon>TitleSpecificScan.cs</DependentUpon>
</EmbeddedResource>
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