]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fixes to the Audio Panel.
authorsr55 <sr55.hb@outlook.com>
Fri, 16 Sep 2011 18:32:02 +0000 (18:32 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 16 Sep 2011 18:32:02 +0000 (18:32 +0000)
- 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

win/CS/Controls/AudioPanel.Designer.cs
win/CS/Controls/AudioPanel.cs
win/CS/Controls/AudioPanel.resx
win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs

index 6b2a0ad5f99b978153a76cf3616099804d40df2d..4bc063b1859197dc8b754f8a73a01ccbfab36436 100644 (file)
@@ -50,13 +50,6 @@ namespace Handbrake.Controls
             this.drp_audioSample = new System.Windows.Forms.ComboBox();\r
             this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
             this.audioList = new System.Windows.Forms.DataGridView();\r
-            this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
-            this.Gain = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
             this.ToolTips = new System.Windows.Forms.ToolTip(this.components);\r
             this.btn_AdvancedAudio = new System.Windows.Forms.Button();\r
             this.btn_addAudioTrack = new wyDay.Controls.SplitButton();\r
@@ -65,6 +58,13 @@ namespace Handbrake.Controls
             this.btn_RemoveTrack = new wyDay.Controls.SplitButton();\r
             this.RemoveTrackMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             this.mnu_ClearAll = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.Source = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.AudioCodec = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.Mixdown = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.Samplerate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.Bitrate = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.DRC = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
+            this.Gain = new System.Windows.Forms.DataGridViewTextBoxColumn();\r
             this.audioMenu.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.audioList)).BeginInit();\r
             this.AddTrackMenu.SuspendLayout();\r
@@ -264,74 +264,6 @@ namespace Handbrake.Controls
             this.ToolTips.SetToolTip(this.audioList, "The audio tracks to be encoded into the output file.");\r
             this.audioList.SelectionChanged += new System.EventHandler(this.audioList_SelectionChanged);\r
             // \r
-            // Source\r
-            // \r
-            this.Source.DataPropertyName = "TrackDisplay";\r
-            this.Source.FillWeight = 49.69727F;\r
-            this.Source.HeaderText = "Source";\r
-            this.Source.Name = "Source";\r
-            this.Source.ReadOnly = true;\r
-            this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            this.Source.Width = 170;\r
-            // \r
-            // AudioCodec\r
-            // \r
-            this.AudioCodec.DataPropertyName = "Encoder";\r
-            this.AudioCodec.HeaderText = "Audio Codec";\r
-            this.AudioCodec.Name = "AudioCodec";\r
-            this.AudioCodec.ReadOnly = true;\r
-            this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            this.AudioCodec.Width = 120;\r
-            // \r
-            // Mixdown\r
-            // \r
-            this.Mixdown.DataPropertyName = "Mixdown";\r
-            this.Mixdown.FillWeight = 49.69727F;\r
-            this.Mixdown.HeaderText = "Mixdown";\r
-            this.Mixdown.Name = "Mixdown";\r
-            this.Mixdown.ReadOnly = true;\r
-            this.Mixdown.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            this.Mixdown.Width = 150;\r
-            // \r
-            // Samplerate\r
-            // \r
-            this.Samplerate.DataPropertyName = "SampleRateDisplayValue";\r
-            this.Samplerate.FillWeight = 49.69727F;\r
-            this.Samplerate.HeaderText = "Samplerate";\r
-            this.Samplerate.Name = "Samplerate";\r
-            this.Samplerate.ReadOnly = true;\r
-            this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            this.Samplerate.Width = 75;\r
-            // \r
-            // Bitrate\r
-            // \r
-            this.Bitrate.DataPropertyName = "BitRateDisplayValue";\r
-            this.Bitrate.FillWeight = 49.69727F;\r
-            this.Bitrate.HeaderText = "Bitrate";\r
-            this.Bitrate.Name = "Bitrate";\r
-            this.Bitrate.ReadOnly = true;\r
-            this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            this.Bitrate.Width = 75;\r
-            // \r
-            // DRC\r
-            // \r
-            this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;\r
-            this.DRC.DataPropertyName = "DRC";\r
-            this.DRC.FillWeight = 96.36334F;\r
-            this.DRC.HeaderText = "DRC";\r
-            this.DRC.Name = "DRC";\r
-            this.DRC.ReadOnly = true;\r
-            this.DRC.Resizable = System.Windows.Forms.DataGridViewTriState.True;\r
-            this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
-            // \r
-            // Gain\r
-            // \r
-            this.Gain.DataPropertyName = "Gain";\r
-            this.Gain.HeaderText = "Gain (dB)";\r
-            this.Gain.Name = "Gain";\r
-            this.Gain.ReadOnly = true;\r
-            this.Gain.Width = 60;\r
-            // \r
             // btn_AdvancedAudio\r
             // \r
             this.btn_AdvancedAudio.BackColor = System.Drawing.Color.Transparent;\r
@@ -399,10 +331,78 @@ namespace Handbrake.Controls
             // mnu_ClearAll\r
             // \r
             this.mnu_ClearAll.Name = "mnu_ClearAll";\r
-            this.mnu_ClearAll.Size = new System.Drawing.Size(152, 22);\r
+            this.mnu_ClearAll.Size = new System.Drawing.Size(118, 22);\r
             this.mnu_ClearAll.Text = "Clear All";\r
             this.mnu_ClearAll.Click += new System.EventHandler(this.Mnu_clear_all_click);\r
             // \r
+            // Source\r
+            // \r
+            this.Source.DataPropertyName = "TrackDisplay";\r
+            this.Source.FillWeight = 49.69727F;\r
+            this.Source.HeaderText = "Source";\r
+            this.Source.Name = "Source";\r
+            this.Source.ReadOnly = true;\r
+            this.Source.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            this.Source.Width = 170;\r
+            // \r
+            // AudioCodec\r
+            // \r
+            this.AudioCodec.DataPropertyName = "AudioEncoderDisplayValue";\r
+            this.AudioCodec.HeaderText = "Audio Codec";\r
+            this.AudioCodec.Name = "AudioCodec";\r
+            this.AudioCodec.ReadOnly = true;\r
+            this.AudioCodec.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            this.AudioCodec.Width = 120;\r
+            // \r
+            // Mixdown\r
+            // \r
+            this.Mixdown.DataPropertyName = "AudioMixdownDisplayValue";\r
+            this.Mixdown.FillWeight = 49.69727F;\r
+            this.Mixdown.HeaderText = "Mixdown";\r
+            this.Mixdown.Name = "Mixdown";\r
+            this.Mixdown.ReadOnly = true;\r
+            this.Mixdown.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            this.Mixdown.Width = 150;\r
+            // \r
+            // Samplerate\r
+            // \r
+            this.Samplerate.DataPropertyName = "SampleRateDisplayValue";\r
+            this.Samplerate.FillWeight = 49.69727F;\r
+            this.Samplerate.HeaderText = "Samplerate";\r
+            this.Samplerate.Name = "Samplerate";\r
+            this.Samplerate.ReadOnly = true;\r
+            this.Samplerate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            this.Samplerate.Width = 75;\r
+            // \r
+            // Bitrate\r
+            // \r
+            this.Bitrate.DataPropertyName = "BitRateDisplayValue";\r
+            this.Bitrate.FillWeight = 49.69727F;\r
+            this.Bitrate.HeaderText = "Bitrate";\r
+            this.Bitrate.Name = "Bitrate";\r
+            this.Bitrate.ReadOnly = true;\r
+            this.Bitrate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            this.Bitrate.Width = 75;\r
+            // \r
+            // DRC\r
+            // \r
+            this.DRC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;\r
+            this.DRC.DataPropertyName = "DRC";\r
+            this.DRC.FillWeight = 96.36334F;\r
+            this.DRC.HeaderText = "DRC";\r
+            this.DRC.Name = "DRC";\r
+            this.DRC.ReadOnly = true;\r
+            this.DRC.Resizable = System.Windows.Forms.DataGridViewTriState.True;\r
+            this.DRC.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;\r
+            // \r
+            // Gain\r
+            // \r
+            this.Gain.DataPropertyName = "Gain";\r
+            this.Gain.HeaderText = "Gain (dB)";\r
+            this.Gain.Name = "Gain";\r
+            this.Gain.ReadOnly = true;\r
+            this.Gain.Width = 60;\r
+            // \r
             // AudioPanel\r
             // \r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;\r
@@ -446,13 +446,6 @@ namespace Handbrake.Controls
         private System.Windows.Forms.DataGridView audioList;\r
         private System.Windows.Forms.ToolTip ToolTips;\r
         private System.Windows.Forms.Button btn_AdvancedAudio;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn Source;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn AudioCodec;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn Mixdown;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn Samplerate;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn Bitrate;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn DRC;\r
-        private System.Windows.Forms.DataGridViewTextBoxColumn Gain;\r
         private System.Windows.Forms.ToolStripMenuItem audioList_MoveToTop;\r
         private System.Windows.Forms.ToolStripMenuItem audioList_MoveToBottom;\r
         private wyDay.Controls.SplitButton btn_addAudioTrack;\r
@@ -461,5 +454,12 @@ namespace Handbrake.Controls
         private wyDay.Controls.SplitButton btn_RemoveTrack;\r
         private System.Windows.Forms.ContextMenuStrip RemoveTrackMenu;\r
         private System.Windows.Forms.ToolStripMenuItem mnu_ClearAll;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn Source;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn AudioCodec;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn Mixdown;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn Samplerate;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn Bitrate;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn DRC;\r
+        private System.Windows.Forms.DataGridViewTextBoxColumn Gain;\r
     }\r
 }\r
index c25d86cb9e8dd601eb5f23d1c4dd84bda3aa716b..59464077ca24cc881c957fa532cd44e3233ef844 100644 (file)
@@ -167,7 +167,7 @@ namespace Handbrake.Controls
         {\r
             ClearAudioList();\r
 \r
-            if (tracks == null)\r
+            if (tracks == null || (drp_audioTrack.SelectedItem != null && drp_audioTrack.SelectedItem.ToString() == AudioHelper.NoneFound.Description))\r
                 return;\r
 \r
             foreach (AudioTrack track in tracks)\r
@@ -248,6 +248,9 @@ namespace Handbrake.Controls
         /// </param>\r
         private void ControlChanged(object sender, EventArgs e)\r
         {\r
+            Control ctl = (Control)sender;\r
+\r
+            // Some Sanity Checking\r
             if (audioList.SelectedRows.Count == 0)\r
             {\r
                 return;\r
@@ -259,8 +262,7 @@ namespace Handbrake.Controls
                 return;\r
             }\r
 \r
-            Control ctl = (Control)sender;\r
-\r
+            // Handle the changed control and selected audio track.\r
             switch (ctl.Name)\r
             {\r
                 case "drp_audioTrack":\r
@@ -980,7 +982,8 @@ namespace Handbrake.Controls
             }\r
 \r
             // If the track isn't DTS, and the encoder is, change it.\r
-            if (track.Encoder == AudioEncoder.DtsPassthrough && !track.ScannedTrack.Format.Contains("DTS"))\r
+            if (track.Encoder == AudioEncoder.DtsPassthrough || track.Encoder == AudioEncoder.DtsHDPassthrough \r
+                && !track.ScannedTrack.Format.Contains("DTS"))\r
             {\r
                 return true;\r
             }\r
index 79c2918691788a2d42be70f352f7f9687b7fa52b..696d4eed5a3fdfa22c05b01448f810b7170cf51e 100644 (file)
   <metadata name="Gain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>True</value>\r
   </metadata>\r
-  <metadata name="ToolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>330, 16</value>\r
-  </metadata>\r
   <metadata name="AddTrackMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>427, 16</value>\r
   </metadata>\r
index 6fcc57e2a2cf4559a2b5ba1356a6cf5e70077278..9a92eab8077889b369360bf87ac4951e0dff480e 100644 (file)
@@ -8,6 +8,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
     using System;\r
     using System.ComponentModel;\r
 \r
+    using HandBrake.ApplicationServices.Functions;\r
     using HandBrake.ApplicationServices.Parsing;\r
     using HandBrake.Interop.Model.Encoding;\r
 \r
@@ -123,6 +124,29 @@ namespace HandBrake.ApplicationServices.Model.Encoding
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets AudioEncoderDisplayValue.\r
+        /// </summary>\r
+        public string AudioEncoderDisplayValue\r
+        {\r
+            get\r
+            {\r
+                return EnumHelper<AudioEncoder>.GetDisplay(this.Encoder);\r
+            }\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets AudioMixdownDisplayValue.\r
+        /// </summary>\r
+        public string AudioMixdownDisplayValue\r
+        {\r
+            get\r
+            {\r
+                return EnumHelper<Mixdown>.GetDisplay(this.MixDown);\r
+            }\r
+        }\r
+\r
+\r
         /// <summary>\r
         /// Gets or sets Audio Mixdown\r
         /// </summary>\r
index a215474ecca2eeb25047fca713e9a6c4f72722f1..f69833e43f3801782948e49914a7b4c0cdb4df6c 100644 (file)
@@ -28,7 +28,7 @@ namespace HandBrake.Interop.Model.Encoding
                [Display(Name = "Passthrough")]\r
                Passthrough,\r
 \r
-               [Display(Name = "Passthrough (AC3)")]\r
+               [Display(Name = "AC3 Passthru")]\r
                Ac3Passthrough,\r
 \r
         [Display(Name = "DTS Passthru")]\r