/// <summary> /// return a FormatPreset corresponding to the user's choice /// </summary> public static FormatPreset DoFFmpegWriterDlg(IWin32Window owner) { FFmpegWriterForm dlg = new FFmpegWriterForm(); dlg.listBox1.Items.AddRange(FormatPreset.GetPresets()); int i = dlg.listBox1.FindStringExact(Global.Config.FFmpegFormat); if (i != ListBox.NoMatches) { dlg.listBox1.SelectedIndex = i; } DialogResult result = dlg.ShowDialog(owner); FormatPreset ret; if (result != DialogResult.OK || dlg.listBox1.SelectedIndex == -1) { ret = null; } else { ret = (FormatPreset)dlg.listBox1.SelectedItem; Global.Config.FFmpegFormat = ret.ToString(); if (ret.Custom) { ret.Commandline = dlg.textBox1.Text; Global.Config.FFmpegCustomCommand = dlg.textBox1.Text; } } dlg.Dispose(); return(ret); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { FormatPreset f = (FormatPreset)listBox1.SelectedItem; label5.Text = "Extension: " + f.defaultext; label3.Text = f.desc; textBox1.Text = f.commandline; textBox1.ReadOnly = !f.custom; } }