From a264b3c24c8ef687cac5325753be29f1b0f1d9f9 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 15 Apr 2011 21:04:18 +0000 Subject: 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 --- win/CS/Controls/AudioPanel.Designer.cs | 172 +++++++++++++++++++-------------- win/CS/Controls/AudioPanel.cs | 22 +++++ win/CS/Controls/AudioPanel.resx | 13 ++- 3 files changed, 129 insertions(+), 78 deletions(-) (limited to 'win/CS/Controls') 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; /// @@ -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 audioTracks = new BindingList(); @@ -50,6 +53,8 @@ namespace Handbrake.Controls drp_audioMix.SelectedItem = "Dolby Pro Logic II"; drp_audioSample.SelectedIndex = 1; + + } /// @@ -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 35, 17 - + True - + + True + + True True - + True - + True - + True \ No newline at end of file -- cgit v1.2.3