From 680ed831fb94849f57565665ed4f467f2d3283e5 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 16 Apr 2011 15:21:42 +0000 Subject: 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 --- win/CS/Controls/AudioPanel.Designer.cs | 40 +-- win/CS/Controls/AudioPanel.cs | 31 +- win/CS/Controls/AudioPanel.resx | 11 +- win/CS/HandBrake.5.1.ReSharper | 379 -------------------- .../HandBrake.ApplicationServices.csproj | 2 +- .../Model/Encoding/AudioTrack.cs | 21 +- .../Settings.StyleCop | 10 +- win/CS/HandBrakeCS.5.0.ReSharper | 388 --------------------- win/CS/HandBrakeCS.csproj | 2 +- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 1 + win/CS/ToolWindows/AdvancedAudio.Designer.cs | 70 +++- win/CS/ToolWindows/AdvancedAudio.cs | 40 +++ 12 files changed, 143 insertions(+), 852 deletions(-) delete mode 100644 win/CS/HandBrake.5.1.ReSharper delete mode 100644 win/CS/HandBrakeCS.5.0.ReSharper diff --git a/win/CS/Controls/AudioPanel.Designer.cs b/win/CS/Controls/AudioPanel.Designer.cs index dd6dc768e..dbc1e84c9 100644 --- a/win/CS/Controls/AudioPanel.Designer.cs +++ b/win/CS/Controls/AudioPanel.Designer.cs @@ -35,7 +35,6 @@ namespace Handbrake.Controls private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AudioPanel)); this.audioMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.audioList_moveup = new System.Windows.Forms.ToolStripMenuItem(); this.audioList_movedown = new System.Windows.Forms.ToolStripMenuItem(); @@ -43,8 +42,6 @@ namespace Handbrake.Controls this.audioList_remove = new System.Windows.Forms.ToolStripMenuItem(); this.btn_RemoveAudioTrack = new System.Windows.Forms.Button(); this.btn_addAudioTrack = new System.Windows.Forms.Button(); - this.lbl_drc = new System.Windows.Forms.Label(); - this.tb_drc = new System.Windows.Forms.TrackBar(); this.label68 = new System.Windows.Forms.Label(); this.drp_audioEncoder = new System.Windows.Forms.ComboBox(); this.drp_audioMix = new System.Windows.Forms.ComboBox(); @@ -65,7 +62,6 @@ namespace Handbrake.Controls 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(); this.SuspendLayout(); // @@ -132,30 +128,6 @@ namespace Handbrake.Controls this.btn_addAudioTrack.UseVisualStyleBackColor = false; this.btn_addAudioTrack.Click += new System.EventHandler(this.AddAudioTrack_Click); // - // lbl_drc - // - this.lbl_drc.AutoSize = true; - this.lbl_drc.BackColor = System.Drawing.Color.Transparent; - this.lbl_drc.Location = new System.Drawing.Point(666, 90); - this.lbl_drc.Name = "lbl_drc"; - this.lbl_drc.Size = new System.Drawing.Size(13, 13); - this.lbl_drc.TabIndex = 62; - this.lbl_drc.Text = "0"; - // - // tb_drc - // - this.tb_drc.BackColor = System.Drawing.SystemColors.Window; - this.tb_drc.LargeChange = 0; - this.tb_drc.Location = new System.Drawing.Point(608, 84); - this.tb_drc.Margin = new System.Windows.Forms.Padding(0); - this.tb_drc.Maximum = 31; - this.tb_drc.Name = "tb_drc"; - this.tb_drc.Size = new System.Drawing.Size(57, 45); - this.tb_drc.TabIndex = 60; - this.tb_drc.TickFrequency = 10; - this.ToolTips.SetToolTip(this.tb_drc, resources.GetString("tb_drc.ToolTip")); - this.tb_drc.Scroll += new System.EventHandler(this.ControlChanged); - // // label68 // this.label68.AutoSize = true; @@ -321,9 +293,9 @@ namespace Handbrake.Controls 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.Location = new System.Drawing.Point(607, 86); this.btn_AdvancedAudio.Name = "btn_AdvancedAudio"; - this.btn_AdvancedAudio.Size = new System.Drawing.Size(71, 23); + this.btn_AdvancedAudio.Size = new System.Drawing.Size(94, 23); this.btn_AdvancedAudio.TabIndex = 70; this.btn_AdvancedAudio.Text = "Advanced"; this.btn_AdvancedAudio.UseVisualStyleBackColor = false; @@ -394,31 +366,29 @@ namespace Handbrake.Controls 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; 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); + this.Controls.Add(this.btn_AdvancedAudio); this.Controls.Add(this.drp_audioSample); this.Controls.Add(this.audioList); this.Controls.Add(this.label68); this.Controls.Add(this.drp_audioBitrate); this.Controls.Add(this.drp_audioMix); this.Controls.Add(this.btn_addAudioTrack); - this.Controls.Add(this.lbl_drc); this.Controls.Add(this.btn_RemoveAudioTrack); this.Controls.Add(this.drp_audioEncoder); - this.Controls.Add(this.tb_drc); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Name = "AudioPanel"; this.Size = new System.Drawing.Size(720, 310); this.audioMenu.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.tb_drc)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.audioList)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -429,8 +399,6 @@ namespace Handbrake.Controls private System.Windows.Forms.Button btn_RemoveAudioTrack; private System.Windows.Forms.Button btn_addAudioTrack; - internal System.Windows.Forms.Label lbl_drc; - internal System.Windows.Forms.TrackBar tb_drc; internal System.Windows.Forms.Label label68; internal System.Windows.Forms.ComboBox drp_audioEncoder; internal System.Windows.Forms.ComboBox drp_audioMix; diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index ddd75d703..ed38c368f 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -230,11 +230,13 @@ namespace Handbrake.Controls // Configure the widgets with values if (drp_audioEncoder.Text.Contains(AC3Passthru) || drp_audioEncoder.Text.Contains(DTSPassthru)) { - drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = tb_drc.Enabled = false; + drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false; + track.Gain = 0; + track.DRC = 0; } else { - drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = tb_drc.Enabled = true; + drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = true; } // Update an item in the Audio list if required. @@ -259,17 +261,6 @@ namespace Handbrake.Controls track.Bitrate = bitrate; break; - case "tb_drc": - 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; - audioList.Select(); - audioList.Refresh(); - break; } audioList.Refresh(); @@ -303,14 +294,6 @@ namespace Handbrake.Controls drp_audioMix.SelectedItem = EnumHelper.GetDescription(track.MixDown); drp_audioSample.SelectedItem = track.SampleRate; drp_audioBitrate.SelectedItem = track.Bitrate; - 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(); - lbl_audioTrack.Text = track.SourceTrack; // Set the Advanced Control. @@ -349,10 +332,6 @@ namespace Handbrake.Controls } // Get Some Values - double drcValue = 0; - if (tb_drc.Value != 0) - drcValue = ((tb_drc.Value - 1) / 10.0) + 1; - int bitrate; double samplerate; @@ -368,7 +347,7 @@ namespace Handbrake.Controls SampleRate = samplerate, Bitrate = bitrate, Gain = 0, - DRC = drcValue + DRC = 0, }; this.audioTracks.Add(track); diff --git a/win/CS/Controls/AudioPanel.resx b/win/CS/Controls/AudioPanel.resx index 483d3e97c..6b186fbc0 100644 --- a/win/CS/Controls/AudioPanel.resx +++ b/win/CS/Controls/AudioPanel.resx @@ -123,14 +123,6 @@ 330, 16 - - Dynamic Range Compression -Adjust the dynamic range of the output audio track. - -For source audio that has a wide dynamic range (very loud and very soft -sequences), DRC allows you to 'compress' the range by making loud -sections softer and soft sections louder - 35, 17 @@ -155,4 +147,7 @@ sections softer and soft sections louder True + + 330, 16 + \ No newline at end of file diff --git a/win/CS/HandBrake.5.1.ReSharper b/win/CS/HandBrake.5.1.ReSharper deleted file mode 100644 index 22ca79976..000000000 --- a/win/CS/HandBrake.5.1.ReSharper +++ /dev/null @@ -1,379 +0,0 @@ - - - - - SOLUTION - - - False - 1 - 1 - 1 - SEPARATE - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - False - False - 1 - 1 - False - - public - protected - internal - private - new - abstract - virtual - override - sealed - static - readonly - extern - unsafe - volatile - - False - False - False - False - True - ALWAYS_USE - ON_SINGLE_LINE - False - True - False - False - True - False - True - True - CHOP_IF_LONG - True - CHOP_IF_LONG - CHOP_IF_LONG - - - True - True - - - $object$_On$event$ - $event$Handler - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - \ 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 7f4592241..65a1b3e5f 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -180,7 +180,7 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - It may be used under the terms of the GNU General Public License. */]]> - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/CS/HandBrakeCS.csproj b/win/CS/HandBrakeCS.csproj index dec9da341..87229cfa6 100644 --- a/win/CS/HandBrakeCS.csproj +++ b/win/CS/HandBrakeCS.csproj @@ -486,7 +486,7 @@ --> - + makensis Installer.nsi diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 0937aea29..65b497534 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -287,6 +287,7 @@ +