Exemplo n.º 1
0
        private void perform()
        {
            if (FFmpeg.isFFmpegDir(Gnd.i.ffmpegDir) == false)
            {
                using (FFmpegDirDlg f = new FFmpegDirDlg())
                {
                    f.ShowDialog();
                }
                if (Gnd.i.ffmpegDir == "")
                {
                    throw new Cancelled("ffmpeg のパスが指定されていないため、続行出来ません。");
                }
                if (FFmpeg.isFFmpegDir(Gnd.i.ffmpegDir) == false)
                {
                    throw new Cancelled("ffmpeg のパスが見つからないため、続行出来ません。");
                }
            }

            try
            {
                BusyDlg.perform(delegate
                {
                    FFmpegBin.i = new FFmpegBin(FFmpeg.getBinDir());

                    try
                    {
                        FFmpegBinTester.doTest();
                    }
                    catch (Exception e)
                    {
                        Gnd.i.ffmpegDir = "";                         // 次回起動時に再設定出来るように..
                        throw new ExceptionCarrier(e);
                    }

                    if (Gnd.i.bootOpenFile != null)
                    {
                        Gnd.i.md = new MediaData(Gnd.i.bootOpenFile);
                    }
                });

                using (MainWin f = new MainWin())
                {
                    f.ShowDialog();
                }
            }
            finally
            {
                BusyDlg.perform(delegate
                {
                    if (Gnd.i.md != null)
                    {
                        Gnd.i.md.Dispose();
                        Gnd.i.md = null;
                    }
                    if (Gnd.i.qsd != null)
                    {
                        Gnd.i.qsd.Dispose();
                        Gnd.i.qsd = null;
                    }
                    if (FFmpegBin.i != null)
                    {
                        FFmpegBin.i.Dispose();
                        FFmpegBin.i = null;
                    }
                });
            }
        }