diff --git a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.Designer.cs b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.Designer.cs index f18bd4966..7df36e32f 100644 --- a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.Designer.cs +++ b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.Designer.cs @@ -31,7 +31,6 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FFmpegOptionsForm)); this.ttHelpTip = new System.Windows.Forms.ToolTip(this.components); - this.tbMP3_qscale = new System.Windows.Forms.TrackBar(); this.pbx264PresetWarning = new System.Windows.Forms.PictureBox(); this.cbx264Preset = new System.Windows.Forms.ComboBox(); this.nudx264CRF = new System.Windows.Forms.NumericUpDown(); @@ -67,6 +66,7 @@ private void InitializeComponent() this.cbOpusBitrate = new System.Windows.Forms.ComboBox(); this.lblOpusBitrate = new System.Windows.Forms.Label(); this.tpVorbis = new System.Windows.Forms.TabPage(); + this.cbVorbisQuality = new System.Windows.Forms.ComboBox(); this.lblVorbisQuality = new System.Windows.Forms.Label(); this.tpMP3 = new System.Windows.Forms.TabPage(); this.lblMP3Quality = new System.Windows.Forms.Label(); @@ -109,8 +109,7 @@ private void InitializeComponent() this.nudQSVBitrate = new System.Windows.Forms.NumericUpDown(); this.lblQSVBitrate = new System.Windows.Forms.Label(); this.btnResetOptions = new System.Windows.Forms.Button(); - this.cbVorbisQuality = new System.Windows.Forms.ComboBox(); - ((System.ComponentModel.ISupportInitialize)(this.tbMP3_qscale)).BeginInit(); + this.cbMP3Quality = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.pbx264PresetWarning)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudx264CRF)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudXvidQscale)).BeginInit(); @@ -145,17 +144,6 @@ private void InitializeComponent() this.ttHelpTip.UseAnimation = false; this.ttHelpTip.UseFading = false; // - // tbMP3_qscale - // - resources.ApplyResources(this.tbMP3_qscale, "tbMP3_qscale"); - this.tbMP3_qscale.BackColor = System.Drawing.SystemColors.Window; - this.tbMP3_qscale.LargeChange = 1; - this.tbMP3_qscale.Maximum = 9; - this.tbMP3_qscale.Name = "tbMP3_qscale"; - this.ttHelpTip.SetToolTip(this.tbMP3_qscale, resources.GetString("tbMP3_qscale.ToolTip")); - this.tbMP3_qscale.Value = 5; - this.tbMP3_qscale.ValueChanged += new System.EventHandler(this.tbMP3_qscale_ValueChanged); - // // pbx264PresetWarning // this.pbx264PresetWarning.Image = global::ShareX.ScreenCaptureLib.Properties.Resources.exclamation_button; @@ -438,6 +426,14 @@ private void InitializeComponent() resources.ApplyResources(this.tpVorbis, "tpVorbis"); this.tpVorbis.Name = "tpVorbis"; // + // cbVorbisQuality + // + this.cbVorbisQuality.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbVorbisQuality.FormattingEnabled = true; + resources.ApplyResources(this.cbVorbisQuality, "cbVorbisQuality"); + this.cbVorbisQuality.Name = "cbVorbisQuality"; + this.cbVorbisQuality.SelectedIndexChanged += new System.EventHandler(this.cbVorbisQuality_SelectedIndexChanged); + // // lblVorbisQuality // resources.ApplyResources(this.lblVorbisQuality, "lblVorbisQuality"); @@ -446,7 +442,7 @@ private void InitializeComponent() // tpMP3 // this.tpMP3.BackColor = System.Drawing.SystemColors.Window; - this.tpMP3.Controls.Add(this.tbMP3_qscale); + this.tpMP3.Controls.Add(this.cbMP3Quality); this.tpMP3.Controls.Add(this.lblMP3Quality); resources.ApplyResources(this.tpMP3, "tpMP3"); this.tpMP3.Name = "tpMP3"; @@ -808,13 +804,13 @@ private void InitializeComponent() this.btnResetOptions.UseVisualStyleBackColor = true; this.btnResetOptions.Click += new System.EventHandler(this.btnResetOptions_Click); // - // cbVorbisQuality + // cbMP3Quality // - this.cbVorbisQuality.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbVorbisQuality.FormattingEnabled = true; - resources.ApplyResources(this.cbVorbisQuality, "cbVorbisQuality"); - this.cbVorbisQuality.Name = "cbVorbisQuality"; - this.cbVorbisQuality.SelectedIndexChanged += new System.EventHandler(this.cbVorbisQuality_SelectedIndexChanged); + this.cbMP3Quality.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbMP3Quality.FormattingEnabled = true; + resources.ApplyResources(this.cbMP3Quality, "cbMP3Quality"); + this.cbMP3Quality.Name = "cbMP3Quality"; + this.cbMP3Quality.SelectedIndexChanged += new System.EventHandler(this.cbMP3Quality_SelectedIndexChanged); // // FFmpegOptionsForm // @@ -848,7 +844,6 @@ private void InitializeComponent() this.Name = "FFmpegOptionsForm"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Load += new System.EventHandler(this.FFmpegOptionsForm_Load); - ((System.ComponentModel.ISupportInitialize)(this.tbMP3_qscale)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbx264PresetWarning)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudx264CRF)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudXvidQscale)).EndInit(); @@ -914,7 +909,6 @@ private void InitializeComponent() private System.Windows.Forms.Label lblAudioSource; private System.Windows.Forms.ComboBox cbAudioCodec; private System.Windows.Forms.Label lblVorbisQuality; - private System.Windows.Forms.TrackBar tbMP3_qscale; private System.Windows.Forms.Label lblMP3Quality; private System.Windows.Forms.TabPage tpAAC; private System.Windows.Forms.Label lblAACBitrate; @@ -969,5 +963,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox cbOpusBitrate; private System.Windows.Forms.Label lblOpusBitrateK; private System.Windows.Forms.ComboBox cbVorbisQuality; + private System.Windows.Forms.ComboBox cbMP3Quality; } } \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs index 672973d8f..ef8e44927 100644 --- a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.cs @@ -62,6 +62,7 @@ public FFmpegOptionsForm(ScreenRecordingOptions options) cbAACBitrate.Items.AddRange(Helpers.Range(64, 320, 32).Cast().ToArray()); cbOpusBitrate.Items.AddRange(Helpers.Range(32, 512, 32).Cast().ToArray()); cbVorbisQuality.Items.AddRange(Helpers.Range(0, 10).Cast().ToArray()); + cbMP3Quality.Items.AddRange(Helpers.Range(9, 0).Cast().ToArray()); } private async Task LoadSettings() @@ -154,7 +155,16 @@ private async Task LoadSettings() } // MP3 - tbMP3_qscale.Value = FFmpegCLIManager.mp3_max - Options.FFmpeg.MP3_QScale; + int indexMP3Quality = cbMP3Quality.Items.IndexOf(Options.FFmpeg.MP3_QScale); + + if (indexMP3Quality > -1) + { + cbMP3Quality.SelectedIndex = indexMP3Quality; + } + else + { + cbMP3Quality.SelectedIndex = cbMP3Quality.Items.IndexOf(4); + } cbCustomCommands.Checked = Options.FFmpeg.UseCustomCommands; @@ -530,9 +540,9 @@ private void cbVorbisQuality_SelectedIndexChanged(object sender, EventArgs e) UpdateUI(); } - private void tbMP3_qscale_ValueChanged(object sender, EventArgs e) + private void cbMP3Quality_SelectedIndexChanged(object sender, EventArgs e) { - Options.FFmpeg.MP3_QScale = FFmpegCLIManager.mp3_max - tbMP3_qscale.Value; + Options.FFmpeg.MP3_QScale = (int)cbMP3Quality.SelectedItem; UpdateUI(); } diff --git a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.resx b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.resx index 933c750db..f0ad3d29a 100644 --- a/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.resx +++ b/ShareX.ScreenCaptureLib/Forms/FFmpegOptionsForm.resx @@ -120,42 +120,11 @@ 17, 17 - - - False - - - NoControl - - - - 0, 32 - - - 312, 32 - - - 1 - - - Range is 0-9 where a lower value is a higher quality. 0-3 will normally produce transparent results, 4 (default) should be close to perceptual transparency, and 6 produces an "acceptable" quality. - - - tbMP3_qscale - - - System.Windows.Forms.TrackBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpMP3 - - - 0 - NoControl + 224, 30 @@ -165,6 +134,7 @@ AutoSize + 6 @@ -820,6 +790,21 @@ A higher value means bad quality, but a low file size. 3 + + True + + + 133, 8 + + + 30, 13 + + + 2 + + + kbps + lblAACBitrateK @@ -832,6 +817,15 @@ A higher value means bad quality, but a low file size. 0 + + 72, 4 + + + 56, 21 + + + 1 + cbAACBitrate @@ -844,6 +838,24 @@ A higher value means bad quality, but a low file size. 1 + + True + + + NoControl + + + 0, 8 + + + 40, 13 + + + 0 + + + Bitrate: + lblAACBitrate @@ -883,6 +895,21 @@ A higher value means bad quality, but a low file size. 0 + + True + + + 133, 8 + + + 30, 13 + + + 2 + + + kbps + lblOpusBitrateK @@ -895,6 +922,15 @@ A higher value means bad quality, but a low file size. 0 + + 72, 4 + + + 56, 21 + + + 1 + cbOpusBitrate @@ -907,6 +943,24 @@ A higher value means bad quality, but a low file size. 1 + + True + + + NoControl + + + 0, 8 + + + 40, 13 + + + 0 + + + Bitrate: + lblOpusBitrate @@ -1024,6 +1078,45 @@ A higher value means bad quality, but a low file size. 2 + + 72, 4 + + + 48, 21 + + + 1 + + + cbMP3Quality + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpMP3 + + + 0 + + + True + + + NoControl + + + 0, 8 + + + 42, 13 + + + 0 + + + Quality: + lblMP3Quality @@ -1084,192 +1177,6 @@ A higher value means bad quality, but a low file size. 1 - - True - - - 149, 8 - - - 30, 13 - - - 2 - - - kbps - - - lblAACBitrateK - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpAAC - - - 0 - - - 72, 4 - - - 72, 21 - - - 1 - - - cbAACBitrate - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpAAC - - - 1 - - - True - - - NoControl - - - 0, 8 - - - 40, 13 - - - 0 - - - Bitrate: - - - lblAACBitrate - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpAAC - - - 2 - - - True - - - 149, 8 - - - 30, 13 - - - 2 - - - kbps - - - lblOpusBitrateK - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpOpus - - - 0 - - - 72, 4 - - - 72, 21 - - - 1 - - - cbOpusBitrate - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpOpus - - - 1 - - - True - - - NoControl - - - 0, 8 - - - 40, 13 - - - 0 - - - Bitrate: - - - lblOpusBitrate - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpOpus - - - 2 - - - True - - - NoControl - - - 0, 8 - - - 42, 13 - - - 0 - - - Quality: - - - lblMP3Quality - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tpMP3 - - - 1 - tpX264