private static void postprocess(MainForm mainForm, Job ajob)
        {
            if (!(ajob is IndexJob))
            {
                return;
            }
            IndexJob job = (IndexJob)ajob;

            if (job.PostprocessingProperties != null)
            {
                return;
            }

            StringBuilder            logBuilder = new StringBuilder();
            VideoUtil                vUtil      = new VideoUtil(mainForm);
            Dictionary <int, string> audioFiles = vUtil.getAllDemuxedAudio(job.Output, 8);

            if (job.LoadSources)
            {
                if (job.DemuxMode != 0)
                {
                    string[] files = new string[audioFiles.Values.Count];
                    audioFiles.Values.CopyTo(files, 0);
                    Util.ThreadSafeRun(mainForm, new MethodInvoker(
                                           delegate
                    {
                        mainForm.Audio.openAudioFile(files);
                    }));
                }
                AviSynthWindow asw = new AviSynthWindow(mainForm, job.Output);
                asw.OpenScript += new OpenScriptCallback(mainForm.Video.openVideoFile);
                asw.Show();
            }
        }
Exemple #2
0
 /// <summary>
 /// creates a dgindex project
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void queueButton_Click(object sender, System.EventArgs e)
 {
     if (configured)
     {
         if (!dialogMode)
         {
             IndexJob job       = generateIndexJob();
             int      jobNumber = mainForm.Jobs.getFreeJobNumber();
             job.Name = "job" + jobNumber;
             lastJob  = job;
             mainForm.Jobs.addJobToQueue(job);
             if (mainForm.Settings.AutoStartQueue)
             {
                 mainForm.Jobs.startEncoding(job);
             }
             if (this.closeOnQueue.Checked)
             {
                 this.Close();
             }
         }
     }
     else
     {
         MessageBox.Show("You must select a Video Input and DGIndex project file to continue",
                         "Configuration incomplete", MessageBoxButtons.OK);
     }
 }
Exemple #3
0
 /// <summary>
 /// creates a dgindex project
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void queueButton_Click(object sender, System.EventArgs e)
 {
     if (Drives.ableToWriteOnThisDrive(Path.GetPathRoot(projectName.Text)))
     {
         if (configured)
         {
             if (!dialogMode)
             {
                 IndexJob job = generateIndexJob();
                 lastJob = job;
                 mainForm.Jobs.addJobsToQueue(job);
                 if (this.closeOnQueue.Checked)
                 {
                     this.Close();
                 }
             }
         }
         else
         {
             MessageBox.Show("You must select a Video Input and DGIndex project file to continue",
                             "Configuration incomplete", MessageBoxButtons.OK);
         }
     }
     else
     {
         MessageBox.Show("MeGUI cannot write on the disc " + Path.GetPathRoot(projectName.Text) + "\n" +
                         "Please, select another output path to save your project...", "Configuration Incomplete", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
 public OneClickPostProcessor(MainForm mainForm, IndexJob ijob)
 {
     this.job      = ijob;
     this.mainForm = mainForm;
     this.jobUtil  = mainForm.JobUtil;
     this.vUtil    = new VideoUtil(mainForm);
 }
        private static LogItem postprocess(MainForm mainForm, Job job)
        {
            if (!(job is IndexJob))
            {
                return(null);
            }
            IndexJob ijob = (IndexJob)job;

            if (ijob.PostprocessingProperties == null)
            {
                return(null);
            }
            OneClickPostProcessor p = new OneClickPostProcessor(mainForm, ijob);

            return(p.postprocess());
        }
Exemple #6
0
        private static LogItem postprocess(MainForm mainForm, Job ajob)
        {
            if (!(ajob is IndexJob))
            {
                return(null);
            }
            IndexJob job = (IndexJob)ajob;

            if (job.PostprocessingProperties != null)
            {
                return(null);
            }

            StringBuilder            logBuilder = new StringBuilder();
            VideoUtil                vUtil      = new VideoUtil(mainForm);
            Dictionary <int, string> audioFiles = vUtil.getAllDemuxedAudio(job.AudioTracks, job.Output, 8);

            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);
        }
 /// <summary>
 /// creates a dgindex project
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void queueButton_Click(object sender, System.EventArgs e)
 {
     if (configured)
     {
         if (!dialogMode)
         {
             IndexJob job = generateIndexJob();
             lastJob = job;
             mainForm.Jobs.addJobsToQueue(job);
             if (this.closeOnQueue.Checked)
             {
                 this.Close();
             }
         }
     }
     else
     {
         MessageBox.Show("You must select a Video Input and DGIndex project file to continue",
                         "Configuration incomplete", MessageBoxButtons.OK);
     }
 }
Exemple #8
0
        private IndexJob generateIndexJob()
        {
            int demuxType = 0;

            if (demuxAllTracks.Checked)
            {
                demuxType = 2;
            }
            else if (demuxSelectedTracks.Checked)
            {
                demuxType = 1;
            }
            IndexJob job = jobUtil.generateIndexJob(this.input.Text, this.projectName.Text, demuxType,
                                                    track1.SelectedIndex, track2.SelectedIndex, null);

            if (this.loadOnComplete.Checked)
            {
                job.LoadSources = true;
            }
            return(job);
        }
Exemple #9
0
        private static void postprocess(MainForm mainForm, Job ajob)
        {
            if (!(ajob is IndexJob))
            {
                return;
            }
            IndexJob job = (IndexJob)ajob;

            if (job.PostprocessingProperties != null)
            {
                return;
            }

            StringBuilder            logBuilder = new StringBuilder();
            VideoUtil                vUtil      = new VideoUtil(mainForm);
            Dictionary <int, string> audioFiles = vUtil.getAllDemuxedAudio(job.Output, 8);

            if (job.LoadSources)
            {
                if (job.DemuxMode != 0)
                {
                    int counter = 0;
                    foreach (int i in audioFiles.Keys)
                    {
                        mainForm.setAudioTrack(counter, audioFiles[i]);
                        if (counter >= 2)
                        {
                            break;
                        }
                        counter++;
                    }
                }
                AviSynthWindow asw = new AviSynthWindow(mainForm, job.Output);
                asw.OpenScript += new OpenScriptCallback(mainForm.Video.openVideoFile);
                asw.Show();
            }
        }
Exemple #10
0
        private void goButton_Click(object sender, EventArgs e)
        {
            if ((verifyAudioSettings() == null) &&
                (VideoSettings != null) &&
                !string.IsNullOrEmpty(input.Filename) &&
                !string.IsNullOrEmpty(workingName.Text))
            {
                FileSize?desiredSize = optionalTargetSizeBox1.Value;

                List <AudioJob>       aJobs        = new List <AudioJob>();
                List <MuxStream>      muxOnlyAudio = new List <MuxStream>();
                List <AudioTrackInfo> audioTracks  = new List <AudioTrackInfo>();
                for (int i = 0; i < audioConfigControl.Count; ++i)
                {
                    if (audioTrack[i].SelectedIndex == 0) // "None"
                    {
                        continue;
                    }

                    string    aInput;
                    TrackInfo info  = null;
                    int       delay = audioConfigControl[i].Delay;
                    if (audioTrack[i].SelectedSCItem.IsStandard)
                    {
                        audioTracks.Add((AudioTrackInfo)audioTrack[i].SelectedObject);
                        aInput = "::" + (audioTrack[i].SelectedIndex - 1) + "::"; // -1 since "None" is first
                        info   = ((AudioTrackInfo)audioTrack[i].SelectedObject).TrackInfo;
                    }
                    else
                    {
                        aInput = audioTrack[i].SelectedText;
                    }

                    if (audioConfigControl[i].DontEncode)
                    {
                        muxOnlyAudio.Add(new MuxStream(aInput, info, delay));
                    }
                    else
                    {
                        aJobs.Add(new AudioJob(aInput, null, null, audioConfigControl[i].Settings, delay));
                    }
                }

                string d2vName = Path.Combine(workingDirectory.Filename, workingName.Text + ".d2v");

                DGIndexPostprocessingProperties dpp = new DGIndexPostprocessingProperties();
                dpp.DAR                        = ar.Value;
                dpp.DirectMuxAudio             = muxOnlyAudio.ToArray();
                dpp.AudioJobs                  = aJobs.ToArray();
                dpp.AutoDeinterlace            = autoDeint.Checked;
                dpp.AvsSettings                = (AviSynthSettings)avsProfile.SelectedProfile.BaseSettings;
                dpp.ChapterFile                = chapterFile.Filename;
                dpp.Container                  = (ContainerType)containerFormat.SelectedItem;
                dpp.FinalOutput                = output.Filename;
                dpp.HorizontalOutputResolution = (int)horizontalResolution.Value;
                dpp.OutputSize                 = desiredSize;
                dpp.SignalAR                   = signalAR.Checked;
                dpp.Splitting                  = splitting.Value;
                dpp.VideoSettings              = VideoSettings.Clone();
                IndexJob job = new IndexJob(input.Filename, d2vName, 1, audioTracks, dpp, false);  //AAA: Only demux selected tracks (prevents leftover files when not all audio tracks are used)
                mainForm.Jobs.addJobsToQueue(job);
                if (this.openOnQueue.Checked)
                {
                    input.PerformClick();
                }
                else
                {
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("You must select audio and video profile, output name and working directory to continue",
                                "Incomplete configuration", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }