2014-05-09 15:14:53 +12:00
|
|
|
|
using HelpersLib;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace ScreenCaptureLib
|
|
|
|
|
{
|
|
|
|
|
public partial class FFmpegCLIOptionsForm : Form
|
|
|
|
|
{
|
|
|
|
|
private FFmpegOptions Options = null;
|
|
|
|
|
|
|
|
|
|
public FFmpegCLIOptionsForm(FFmpegOptions options)
|
|
|
|
|
{
|
|
|
|
|
Options = options;
|
|
|
|
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.Text = string.Format("{0} - FFmpeg CLI Options", Application.ProductName);
|
|
|
|
|
this.Icon = ShareXResources.Icon;
|
|
|
|
|
|
|
|
|
|
LoadSettings();
|
|
|
|
|
UpdateUI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LoadSettings()
|
|
|
|
|
{
|
|
|
|
|
comboBoxCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegVideoCodec>());
|
|
|
|
|
comboBoxCodec.SelectedIndex = (int)Options.VideoCodec;
|
|
|
|
|
|
|
|
|
|
comboBoxExtension.Text = Options.Extension;
|
|
|
|
|
|
2014-05-09 19:28:37 +12:00
|
|
|
|
nudCRF.Value = Options.CRF.Between((int)nudCRF.Minimum, (int)nudCRF.Maximum);
|
2014-05-09 15:14:53 +12:00
|
|
|
|
|
|
|
|
|
comboBoxPreset.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegPreset>());
|
|
|
|
|
comboBoxPreset.SelectedIndex = (int)Options.Preset;
|
2014-05-09 18:41:16 +12:00
|
|
|
|
|
2014-05-09 19:28:37 +12:00
|
|
|
|
nudQscale.Value = Options.qscale.Between((int)nudQscale.Minimum, (int)nudQscale.Maximum);
|
2014-05-09 15:14:53 +12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void comboBoxCodec_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Options.VideoCodec = (FFmpegVideoCodec)comboBoxCodec.SelectedIndex;
|
|
|
|
|
UpdateUI();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void comboBoxExtension_SelectedValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Options.Extension = comboBoxExtension.Text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void nudCRF_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2014-05-09 18:41:16 +12:00
|
|
|
|
Options.CRF = (int)nudCRF.Value;
|
2014-05-09 15:14:53 +12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void comboBoxPreset_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Options.Preset = (FFmpegPreset)comboBoxPreset.SelectedIndex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateUI()
|
|
|
|
|
{
|
2014-05-09 18:41:16 +12:00
|
|
|
|
groupBoxH263.Enabled = Options.VideoCodec == FFmpegVideoCodec.libxvid || Options.VideoCodec == FFmpegVideoCodec.mpeg4;
|
|
|
|
|
groupBoxH264.Enabled = Options.VideoCodec == FFmpegVideoCodec.libx264 || Options.VideoCodec == FFmpegVideoCodec.libvpx;
|
2014-05-09 15:14:53 +12:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DialogResult = DialogResult.OK;
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
DialogResult = DialogResult.Cancel;
|
|
|
|
|
Close();
|
|
|
|
|
}
|
2014-05-09 18:41:16 +12:00
|
|
|
|
|
|
|
|
|
private void nudQscale_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Options.qscale = (int)nudQscale.Value;
|
|
|
|
|
}
|
2014-05-09 15:14:53 +12:00
|
|
|
|
}
|
|
|
|
|
}
|