FFmpegOptionsForm UI changes

This commit is contained in:
Jaex 2023-07-22 14:20:28 +03:00
parent 63ae0947ac
commit 89407978b1
3 changed files with 703 additions and 371 deletions

View file

@ -71,6 +71,9 @@ private void InitializeComponent()
this.lblGIFDither = new System.Windows.Forms.Label();
this.lblGIFStatsMode = new System.Windows.Forms.Label();
this.tpAMF = new System.Windows.Forms.TabPage();
this.lblAMFBitrateK = new System.Windows.Forms.Label();
this.nudAMFBitrate = new System.Windows.Forms.NumericUpDown();
this.lblAMFBitrate = new System.Windows.Forms.Label();
this.cbAMFQuality = new System.Windows.Forms.ComboBox();
this.lblAMFQuality = new System.Windows.Forms.Label();
this.cbAMFUsage = new System.Windows.Forms.ComboBox();
@ -81,8 +84,6 @@ private void InitializeComponent()
this.lblQSVPreset = new System.Windows.Forms.Label();
this.nudQSVBitrate = new System.Windows.Forms.NumericUpDown();
this.lblQSVBitrate = new System.Windows.Forms.Label();
this.btnTest = new System.Windows.Forms.Button();
this.btnCopyPreview = new System.Windows.Forms.Button();
this.tcFFmpegAudioCodecs = new ShareX.HelpersLib.TablessControl();
this.tpAAC = new System.Windows.Forms.TabPage();
this.lblAACQuality = new System.Windows.Forms.Label();
@ -100,15 +101,11 @@ private void InitializeComponent()
this.btnHelperDevicesHelp = new System.Windows.Forms.Button();
this.lblHelperDevices = new System.Windows.Forms.Label();
this.btnInstallHelperDevices = new System.Windows.Forms.Button();
this.eiFFmpeg = new ShareX.HelpersLib.ExportImportControl();
this.lblCommandLineArgs = new System.Windows.Forms.Label();
this.lblCommandLinePreview = new System.Windows.Forms.Label();
this.cbUseCustomFFmpegPath = new System.Windows.Forms.CheckBox();
this.lblVideoEncoder = new System.Windows.Forms.Label();
this.lblAudioEncoder = new System.Windows.Forms.Label();
this.lblAMFBitrateK = new System.Windows.Forms.Label();
this.nudAMFBitrate = new System.Windows.Forms.NumericUpDown();
this.lblAMFBitrate = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.nudx264CRF)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudXvidQscale)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbVorbis_qscale)).BeginInit();
@ -127,6 +124,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.nudNVENCBitrate)).BeginInit();
this.tpGIF.SuspendLayout();
this.tpAMF.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAMFBitrate)).BeginInit();
this.tpQSV.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudQSVBitrate)).BeginInit();
this.tcFFmpegAudioCodecs.SuspendLayout();
@ -134,7 +132,6 @@ private void InitializeComponent()
this.tpOpus.SuspendLayout();
this.tpVorbis.SuspendLayout();
this.tpMP3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAMFBitrate)).BeginInit();
this.SuspendLayout();
//
// lblx264CRF
@ -544,6 +541,37 @@ private void InitializeComponent()
this.tpAMF.Name = "tpAMF";
this.tpAMF.UseVisualStyleBackColor = true;
//
// lblAMFBitrateK
//
resources.ApplyResources(this.lblAMFBitrateK, "lblAMFBitrateK");
this.lblAMFBitrateK.Name = "lblAMFBitrateK";
//
// nudAMFBitrate
//
resources.ApplyResources(this.nudAMFBitrate, "nudAMFBitrate");
this.nudAMFBitrate.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.nudAMFBitrate.Minimum = new decimal(new int[] {
100,
0,
0,
0});
this.nudAMFBitrate.Name = "nudAMFBitrate";
this.nudAMFBitrate.Value = new decimal(new int[] {
3000,
0,
0,
0});
this.nudAMFBitrate.ValueChanged += new System.EventHandler(this.nudAMFBitrate_ValueChanged);
//
// lblAMFBitrate
//
resources.ApplyResources(this.lblAMFBitrate, "lblAMFBitrate");
this.lblAMFBitrate.Name = "lblAMFBitrate";
//
// cbAMFQuality
//
this.cbAMFQuality.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -625,20 +653,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblQSVBitrate, "lblQSVBitrate");
this.lblQSVBitrate.Name = "lblQSVBitrate";
//
// btnTest
//
resources.ApplyResources(this.btnTest, "btnTest");
this.btnTest.Name = "btnTest";
this.btnTest.UseVisualStyleBackColor = true;
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// btnCopyPreview
//
resources.ApplyResources(this.btnCopyPreview, "btnCopyPreview");
this.btnCopyPreview.Name = "btnCopyPreview";
this.btnCopyPreview.UseVisualStyleBackColor = true;
this.btnCopyPreview.Click += new System.EventHandler(this.btnCopyPreview_Click);
//
// tcFFmpegAudioCodecs
//
this.tcFFmpegAudioCodecs.Controls.Add(this.tpAAC);
@ -755,16 +769,6 @@ private void InitializeComponent()
this.btnInstallHelperDevices.UseVisualStyleBackColor = true;
this.btnInstallHelperDevices.Click += new System.EventHandler(this.btnInstallHelperDevices_Click);
//
// eiFFmpeg
//
this.eiFFmpeg.DefaultFileName = null;
resources.ApplyResources(this.eiFFmpeg, "eiFFmpeg");
this.eiFFmpeg.Name = "eiFFmpeg";
this.eiFFmpeg.ObjectType = null;
this.eiFFmpeg.SerializationBinder = null;
this.eiFFmpeg.ExportRequested += new ShareX.HelpersLib.ExportImportControl.ExportEventHandler(this.eiFFmpeg_ExportRequested);
this.eiFFmpeg.ImportRequested += new ShareX.HelpersLib.ExportImportControl.ImportEventHandler(this.eiFFmpeg_ImportRequested);
//
// lblCommandLineArgs
//
resources.ApplyResources(this.lblCommandLineArgs, "lblCommandLineArgs");
@ -792,37 +796,6 @@ private void InitializeComponent()
resources.ApplyResources(this.lblAudioEncoder, "lblAudioEncoder");
this.lblAudioEncoder.Name = "lblAudioEncoder";
//
// lblAMFBitrateK
//
resources.ApplyResources(this.lblAMFBitrateK, "lblAMFBitrateK");
this.lblAMFBitrateK.Name = "lblAMFBitrateK";
//
// nudAMFBitrate
//
resources.ApplyResources(this.nudAMFBitrate, "nudAMFBitrate");
this.nudAMFBitrate.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.nudAMFBitrate.Minimum = new decimal(new int[] {
100,
0,
0,
0});
this.nudAMFBitrate.Name = "nudAMFBitrate";
this.nudAMFBitrate.Value = new decimal(new int[] {
3000,
0,
0,
0});
this.nudAMFBitrate.ValueChanged += new System.EventHandler(this.nudAMFBitrate_ValueChanged);
//
// lblAMFBitrate
//
resources.ApplyResources(this.lblAMFBitrate, "lblAMFBitrate");
this.lblAMFBitrate.Name = "lblAMFBitrate";
//
// FFmpegOptionsForm
//
resources.ApplyResources(this, "$this");
@ -846,12 +819,9 @@ private void InitializeComponent()
this.Controls.Add(this.cbVideoSource);
this.Controls.Add(this.btnFFmpegBrowse);
this.Controls.Add(this.lblVideoSource);
this.Controls.Add(this.eiFFmpeg);
this.Controls.Add(this.cbAudioSource);
this.Controls.Add(this.txtFFmpegPath);
this.Controls.Add(this.lblAudioSource);
this.Controls.Add(this.btnCopyPreview);
this.Controls.Add(this.btnTest);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
@ -882,6 +852,7 @@ private void InitializeComponent()
this.tpGIF.PerformLayout();
this.tpAMF.ResumeLayout(false);
this.tpAMF.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAMFBitrate)).EndInit();
this.tpQSV.ResumeLayout(false);
this.tpQSV.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudQSVBitrate)).EndInit();
@ -894,7 +865,6 @@ private void InitializeComponent()
this.tpVorbis.PerformLayout();
this.tpMP3.ResumeLayout(false);
this.tpMP3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudAMFBitrate)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -918,8 +888,6 @@ private void InitializeComponent()
private System.Windows.Forms.TabPage tpX264;
private System.Windows.Forms.TabPage tpVpx;
private System.Windows.Forms.TabPage tpXvid;
private System.Windows.Forms.Button btnTest;
private System.Windows.Forms.Button btnCopyPreview;
private HelpersLib.TablessControl tcFFmpegAudioCodecs;
private System.Windows.Forms.TabPage tpVorbis;
private System.Windows.Forms.TabPage tpMP3;
@ -936,7 +904,6 @@ private void InitializeComponent()
private System.Windows.Forms.TrackBar tbAACBitrate;
private System.Windows.Forms.Label lblAACQuality;
private System.Windows.Forms.CheckBox cbCustomCommands;
private ShareX.HelpersLib.ExportImportControl eiFFmpeg;
private System.Windows.Forms.Label lblVP8BitrateK;
private System.Windows.Forms.NumericUpDown nudVP8Bitrate;
private System.Windows.Forms.Label lblVP8Bitrate;

View file

@ -48,7 +48,6 @@ public FFmpegOptionsForm(ScreenRecordingOptions options)
InitializeComponent();
ShareXResources.ApplyTheme(this);
eiFFmpeg.ObjectType = typeof(FFmpegOptions);
cbVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegVideoCodec>());
cbAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegAudioCodec>());
cbx264Preset.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegPreset>());
@ -510,38 +509,6 @@ private void txtUserArgs_TextChanged(object sender, EventArgs e)
UpdateUI();
}
private void btnTest_Click(object sender, EventArgs e)
{
if (File.Exists(Options.FFmpeg.FFmpegPath))
{
try
{
using (Process process = new Process())
{
ProcessStartInfo psi = new ProcessStartInfo()
{
FileName = "cmd.exe",
WorkingDirectory = Path.GetTempPath(),
Arguments = $"/k {Path.GetFileName(Options.FFmpeg.FFmpegPath)} {Options.GetFFmpegCommands()}",
UseShellExecute = true
};
process.StartInfo = psi;
process.Start();
}
}
catch (Exception ex)
{
DebugHelper.WriteException(ex);
}
}
}
private void btnCopyPreview_Click(object sender, EventArgs e)
{
ClipboardHelpers.CopyText($"{Path.GetFileName(Options.FFmpeg.FFmpegPath)} {Options.GetFFmpegCommands()}");
}
private void cbCustomCommands_CheckedChanged(object sender, EventArgs e)
{
Options.FFmpeg.UseCustomCommands = cbCustomCommands.Checked;
@ -564,21 +531,5 @@ private void txtCommandLinePreview_TextChanged(object sender, EventArgs e)
{
Options.FFmpeg.CustomCommands = txtCommandLinePreview.Text;
}
private object eiFFmpeg_ExportRequested()
{
return Options.FFmpeg;
}
private async void eiFFmpeg_ImportRequested(object obj)
{
if (obj is FFmpegOptions ffmpegOptions)
{
string tempFFmpegPath = Options.FFmpeg.CLIPath;
Options.FFmpeg = ffmpegOptions;
Options.FFmpeg.CLIPath = tempFFmpegPath;
await SettingsLoad();
}
}
}
}

File diff suppressed because it is too large Load diff