Example #1
0
        private static LogItem postprocess(MainForm mainForm, Job ajob)
        {
            if (!(ajob is DGIIndexJob))
            {
                return(null);
            }
            DGIIndexJob job = (DGIIndexJob)ajob;

            StringBuilder            logBuilder = new StringBuilder();
            Dictionary <int, string> audioFiles = new Dictionary <int, string>();

            if ((job.AudioTracks != null && job.AudioTracks.Count > 0) || job.DemuxMode > 0)
            {
                List <string> arrFilesToDelete = new List <string>();
                audioFiles = AudioUtil.GetAllDemuxedAudioFromDGI(job.AudioTracks, out arrFilesToDelete, job.Output, null);
                job.FilesToDelete.AddRange(arrFilesToDelete);
            }

            if (!job.OneClickProcessing)
            {
                job.FilesToDelete.Add(Path.ChangeExtension(job.Output, ".log"));
            }
            if (!Path.ChangeExtension(job.Output, ".log").Equals(Path.ChangeExtension(job.Input, ".log")))
            {
                job.FilesToDelete.Add(Path.ChangeExtension(job.Input, ".log"));
            }

            if (job.LoadSources)
            {
                if (audioFiles.Count > 0)
                {
                    string[] files = new string[audioFiles.Values.Count];
                    audioFiles.Values.CopyTo(files, 0);
                    Util.ThreadSafeRun(mainForm, new MethodInvoker(
                                           delegate
                    {
                        mainForm.Audio.openAudioFile(files);
                    }));
                }
                // if the above needed delegation for openAudioFile this needs it for openVideoFile?
                // It seems to fix the problem of ASW dissapearing as soon as it appears on a system (Vista X64)
                Util.ThreadSafeRun(mainForm, new MethodInvoker(
                                       delegate
                {
                    AviSynthWindow asw = new AviSynthWindow(mainForm, job.Output);
                    asw.OpenScript    += new OpenScriptCallback(mainForm.Video.openVideoFile);
                    asw.Show();
                }));
            }

            return(null);
        }
Example #2
0
        private static LogItem postprocess(MainForm mainForm, Job ajob)
        {
            if (!(ajob is DGIIndexJob))
            {
                return(null);
            }
            DGIIndexJob job = (DGIIndexJob)ajob;

            StringBuilder            logBuilder       = new StringBuilder();
            VideoUtil                vUtil            = new VideoUtil(mainForm);
            List <string>            arrFilesToDelete = new List <string>();
            Dictionary <int, string> audioFiles       = vUtil.getAllDemuxedAudio(job.AudioTracks, new List <AudioTrackInfo>(), out arrFilesToDelete, job.Output, null);

            if (job.LoadSources)
            {
                if (job.DemuxMode != 0 && audioFiles.Count > 0)
                {
                    string[] files = new string[audioFiles.Values.Count];
                    audioFiles.Values.CopyTo(files, 0);
                    Util.ThreadSafeRun(mainForm, new MethodInvoker(
                                           delegate
                    {
                        mainForm.Audio.openAudioFile(files);
                    }));
                }
                // if the above needed delegation for openAudioFile this needs it for openVideoFile?
                // It seems to fix the problem of ASW dissapearing as soon as it appears on a system (Vista X64)
                Util.ThreadSafeRun(mainForm, new MethodInvoker(
                                       delegate
                {
                    AviSynthWindow asw = new AviSynthWindow(mainForm, job.Output);
                    asw.OpenScript    += new OpenScriptCallback(mainForm.Video.openVideoFile);
                    asw.Show();
                }));
            }

            return(null);
        }