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); } }