diff --git a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs index 54213cca3..97785c8b3 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs +++ b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs @@ -81,6 +81,7 @@ private void InitializeComponent() this.btnRefreshSources = new System.Windows.Forms.Button(); this.cbShowError = new System.Windows.Forms.CheckBox(); this.btnHelp = new System.Windows.Forms.Button(); + this.eiFFmpeg = new HelpersLib.UserControls.ExportImportControl(); ((System.ComponentModel.ISupportInitialize)(this.nudx264CRF)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudQscale)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudVPxCRF)).BeginInit(); @@ -687,20 +688,31 @@ private void InitializeComponent() // // btnHelp // - this.btnHelp.Location = new System.Drawing.Point(599, 413); + this.btnHelp.Location = new System.Drawing.Point(592, 412); this.btnHelp.Name = "btnHelp"; - this.btnHelp.Size = new System.Drawing.Size(59, 24); + this.btnHelp.Size = new System.Drawing.Size(64, 24); this.btnHelp.TabIndex = 0; this.btnHelp.Text = "Help..."; this.btnHelp.UseVisualStyleBackColor = true; this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click); // + // eiFFmpeg + // + this.eiFFmpeg.Location = new System.Drawing.Point(448, 412); + this.eiFFmpeg.Name = "eiFFmpeg"; + this.eiFFmpeg.ObjectType = null; + this.eiFFmpeg.Size = new System.Drawing.Size(136, 24); + this.eiFFmpeg.TabIndex = 12; + this.eiFFmpeg.ExportRequested += new HelpersLib.UserControls.ExportImportControl.ExportEventHandler(this.eiFFmpeg_ExportRequested); + this.eiFFmpeg.ImportRequested += new HelpersLib.UserControls.ExportImportControl.ImportEventHandler(this.eiFFmpeg_ImportRequested); + // // FFmpegOptionsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(666, 445); + this.Controls.Add(this.eiFFmpeg); this.Controls.Add(this.btnHelp); this.Controls.Add(this.cbShowError); this.Controls.Add(this.btnRefreshSources); @@ -811,5 +823,6 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbShowError; private System.Windows.Forms.CheckBox cbCustomCommands; private System.Windows.Forms.Button btnHelp; + private HelpersLib.UserControls.ExportImportControl eiFFmpeg; } } \ No newline at end of file diff --git a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs index d8671c6ba..e2c0029ec 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs +++ b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs @@ -42,8 +42,11 @@ public FFmpegOptionsForm(ScreencastOptions options) { InitializeComponent(); Icon = ShareXResources.Icon; - Options = options; + eiFFmpeg.ObjectType = typeof(FFmpegOptions); + cboVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions()); + cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions()); + cbPreset.Items.AddRange(Helpers.GetEnumDescriptions()); if (Options != null) { @@ -55,9 +58,8 @@ private void SettingsLoad() { // General RefreshSourcesAsync(); - cboVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions()); + cboVideoCodec.SelectedIndex = (int)Options.FFmpeg.VideoCodec; - cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions()); cboAudioCodec.SelectedIndex = (int)Options.FFmpeg.AudioCodec; cbShowError.Checked = Options.FFmpeg.ShowError; @@ -73,7 +75,6 @@ private void SettingsLoad() // x264 nudx264CRF.Value = Options.FFmpeg.x264_CRF.Between((int)nudx264CRF.Minimum, (int)nudx264CRF.Maximum); - cbPreset.Items.AddRange(Helpers.GetEnumDescriptions()); cbPreset.SelectedIndex = (int)Options.FFmpeg.Preset; // VPx @@ -355,5 +356,23 @@ private void btnHelp_Click(object sender, EventArgs e) { Helpers.OpenURL("https://docs.google.com/document/d/1aKLSqsouoeC5Tjf-Z3P880V3rpzvQU0A2Clayn9ElZo/edit?usp=sharing"); } + + private object eiFFmpeg_ExportRequested() + { + return Options.FFmpeg; + } + + private void eiFFmpeg_ImportRequested(object obj) + { + FFmpegOptions ffmpegOptions = obj as FFmpegOptions; + + if (ffmpegOptions != null) + { + string tempFFmpegPath = Options.FFmpeg.CLIPath; + Options.FFmpeg = ffmpegOptions; + Options.FFmpeg.CLIPath = tempFFmpegPath; + SettingsLoad(); + } + } } } \ No newline at end of file diff --git a/ShareX/Forms/EncoderProgramForm.Designer.cs b/ShareX/Forms/EncoderProgramForm.Designer.cs index 4865da495..fe8711051 100644 --- a/ShareX/Forms/EncoderProgramForm.Designer.cs +++ b/ShareX/Forms/EncoderProgramForm.Designer.cs @@ -126,7 +126,6 @@ private void InitializeComponent() // // btnCancel // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.Location = new System.Drawing.Point(240, 112); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); @@ -137,7 +136,6 @@ private void InitializeComponent() // // btnOK // - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOK.Location = new System.Drawing.Point(160, 112); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); diff --git a/ShareX/Forms/EncoderProgramForm.resx b/ShareX/Forms/EncoderProgramForm.resx index 7080a7d11..1af7de150 100644 --- a/ShareX/Forms/EncoderProgramForm.resx +++ b/ShareX/Forms/EncoderProgramForm.resx @@ -112,9 +112,9 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file