示例#1
0
        //... commented out because we have created menu shortcuts
        //public override bool TriggerByKeyPress(KeyEventArgs e)
        //{
        //    return (e.Control && e.Shift && e.KeyCode == Keys.E);
        //}

        public override void Run()
        {
            if (String.IsNullOrEmpty(Context.CurFileName))
            {
                Context.iiii("Context.CurFileName is null!");
                return;
            }
            var nBreakups    = Context.Proj.RenderBreakupsCount();
            var fileOutVideo = Context.CurFileName + Settings.Default.ExportVideoExtension;

            if (nBreakups <= 1)
            {
                RenderToAvi(Context.CurFileName, Context.Proj, fileOutVideo, Settings.Default.mencoderArguments);
            }
            else
            {
                rawDumpFolder = Context.CheckRawDumpFolderIsOkAndGiveItToMe();
                var subProjs     = Context.Proj.RenderBreakupsSplitIntoSubProjects();
                var aviFilenames = new string[subProjs.Length];
                for (int i = 0; i < subProjs.Length; i++)
                {
                    aviFilenames[i] = GetRawVideoSegmentOutputPath(i);
                }
                UtilsOp.OpenWinExplorerAndSelectNothing(Path.GetDirectoryName(aviFilenames[0]));
                var anyExist = aviFilenames.FirstOrDefault(x => File.Exists(x));
                if (anyExist != null)
                {
                    if (!Context.DialogConfirm("Files exist! Proceed?", "Some segment files here exist, e.g. " + Path.GetFileName(anyExist) + @".
They will not be overwritten, because I assume you want to save long rendering time.
(If you wish to rerender those files you must delete them manually)
So, anyways, proceed, do I?"))
                    {
                        return;
                    }
                }
                for (int i = 0; i < subProjs.Length; i++)
                {
                    if (!File.Exists(aviFilenames[i]))
                    {
                        RenderToAvi(Context.CurFileName, subProjs[i], aviFilenames[i], Settings.Default.mencoderArgumentsRaw);
                    }
                }
                var vdubScript = GetVdubScriptOutputPathForConcatRawSegments();
                VidkaIO.MakeVDubScriptForOpenTheseVideosAndStartRender(aviFilenames, fileOutVideo, vdubScript);
                OpUtils.OpenVirtualDubAndRunScript(vdubScript);
            }
        }