From: sr55 Date: Fri, 16 Sep 2011 18:32:02 +0000 (+0000) Subject: WinGui: Fixes to the Audio Panel. X-Git-Tag: 0.9.6~243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=454b357568586289bea24d6c0043fe415bb28512;p=handbrake WinGui: Fixes to the Audio Panel. - Fix a display issue with Encoder and Mixdown on the data grid. - Don't try to load tracks if there isn't any. - Fix an issue with auto-correction of Passthru option. (DTS-HD would not auto-correct to the correct passthru for the source track type) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4225 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/CS/Controls/AudioPanel.Designer.cs b/win/CS/Controls/AudioPanel.Designer.cs index 6b2a0ad5f..4bc063b18 100644 --- a/win/CS/Controls/AudioPanel.Designer.cs +++ b/win/CS/Controls/AudioPanel.Designer.cs @@ -50,13 +50,6 @@ namespace Handbrake.Controls this.drp_audioSample = new System.Windows.Forms.ComboBox(); this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components); this.audioList = new System.Windows.Forms.DataGridView(); - 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.ToolTips = new System.Windows.Forms.ToolTip(this.components); this.btn_AdvancedAudio = new System.Windows.Forms.Button(); this.btn_addAudioTrack = new wyDay.Controls.SplitButton(); @@ -65,6 +58,13 @@ namespace Handbrake.Controls this.btn_RemoveTrack = new wyDay.Controls.SplitButton(); this.RemoveTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem(); + 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.audioList)).BeginInit(); this.AddTrackMenu.SuspendLayout(); @@ -264,74 +264,6 @@ 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); // - // Source - // - this.Source.DataPropertyName = "TrackDisplay"; - 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.ReadOnly = true; - this.Gain.Width = 60; - // // btn_AdvancedAudio // this.btn_AdvancedAudio.BackColor = System.Drawing.Color.Transparent; @@ -399,10 +331,78 @@ namespace Handbrake.Controls // mnu_ClearAll // this.mnu_ClearAll.Name = "mnu_ClearAll"; - this.mnu_ClearAll.Size = new System.Drawing.Size(152, 22); + this.mnu_ClearAll.Size = new System.Drawing.Size(118, 22); this.mnu_ClearAll.Text = "Clear All"; this.mnu_ClearAll.Click += new System.EventHandler(this.Mnu_clear_all_click); // + // Source + // + this.Source.DataPropertyName = "TrackDisplay"; + 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 = "AudioEncoderDisplayValue"; + 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 = "AudioMixdownDisplayValue"; + 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.ReadOnly = true; + this.Gain.Width = 60; + // // AudioPanel // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -446,13 +446,6 @@ namespace Handbrake.Controls 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; private System.Windows.Forms.ToolStripMenuItem audioList_MoveToTop; private System.Windows.Forms.ToolStripMenuItem audioList_MoveToBottom; private wyDay.Controls.SplitButton btn_addAudioTrack; @@ -461,5 +454,12 @@ namespace Handbrake.Controls private wyDay.Controls.SplitButton btn_RemoveTrack; private System.Windows.Forms.ContextMenuStrip RemoveTrackMenu; private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll; + 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 c25d86cb9..59464077c 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -167,7 +167,7 @@ namespace Handbrake.Controls { ClearAudioList(); - if (tracks == null) + if (tracks == null || (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description)) return; foreach (AudioTrack track in tracks) @@ -248,6 +248,9 @@ namespace Handbrake.Controls /// private void ControlChanged(object sender, EventArgs e) { + Control ctl = (Control)sender; + + // Some Sanity Checking if (audioList.SelectedRows.Count == 0) { return; @@ -259,8 +262,7 @@ namespace Handbrake.Controls return; } - Control ctl = (Control)sender; - + // Handle the changed control and selected audio track. switch (ctl.Name) { case "drp_audioTrack": @@ -980,7 +982,8 @@ namespace Handbrake.Controls } // If the track isn't DTS, and the encoder is, change it. - if (track.Encoder == AudioEncoder.DtsPassthrough && !track.ScannedTrack.Format.Contains("DTS")) + if (track.Encoder == AudioEncoder.DtsPassthrough || track.Encoder == AudioEncoder.DtsHDPassthrough + && !track.ScannedTrack.Format.Contains("DTS")) { return true; } diff --git a/win/CS/Controls/AudioPanel.resx b/win/CS/Controls/AudioPanel.resx index 79c291869..696d4eed5 100644 --- a/win/CS/Controls/AudioPanel.resx +++ b/win/CS/Controls/AudioPanel.resx @@ -147,9 +147,6 @@ True - - 330, 16 - 427, 16 diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs index 6fcc57e2a..9a92eab80 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs @@ -8,6 +8,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding using System; using System.ComponentModel; + using HandBrake.ApplicationServices.Functions; using HandBrake.ApplicationServices.Parsing; using HandBrake.Interop.Model.Encoding; @@ -123,6 +124,29 @@ namespace HandBrake.ApplicationServices.Model.Encoding } } + /// + /// Gets AudioEncoderDisplayValue. + /// + public string AudioEncoderDisplayValue + { + get + { + return EnumHelper.GetDisplay(this.Encoder); + } + } + + /// + /// Gets AudioMixdownDisplayValue. + /// + public string AudioMixdownDisplayValue + { + get + { + return EnumHelper.GetDisplay(this.MixDown); + } + } + + /// /// Gets or sets Audio Mixdown /// diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs index a215474ec..f69833e43 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs @@ -28,7 +28,7 @@ namespace HandBrake.Interop.Model.Encoding [Display(Name = "Passthrough")] Passthrough, - [Display(Name = "Passthrough (AC3)")] + [Display(Name = "AC3 Passthru")] Ac3Passthrough, [Display(Name = "DTS Passthru")]