Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
 public IDisposable AcquireVideoCodecToken(System.Windows.Forms.IWin32Window hwnd)
 {
     return(FFmpegWriterForm.DoFFmpegWriterDlg(hwnd));
 }
Esempio n. 3
0
		/// <summary>
		/// return a formatpreset corresponding to the user's choice
		/// </summary>
		/// <param name="owner"></param>
		/// <returns></returns>
		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;
		}