private Destination CreateDestination(EncodeTask job) { Destination destination = new Destination { File = job.Destination, Mp4Options = new Mp4Options { IpodAtom = VideoEncoderHelpers.IsH264(job.VideoEncoder) ? job.IPod5GSupport : false, Mp4Optimize = job.OptimizeMP4 }, ChapterMarkers = job.IncludeChapterMarkers, AlignAVStart = job.AlignAVStart, Mux = EnumHelper <OutputFormat> .GetShortName(job.OutputFormat), ChapterList = new List <Chapter>() }; if (job.IncludeChapterMarkers) { foreach (ChapterMarker item in job.ChapterNames) { Chapter chapter = new Chapter { Name = item.ChapterName }; destination.ChapterList.Add(chapter); } } return(destination); }
private void SetExtension(string newExtension) { // Make sure the output extension is set correctly based on the users preferences and selection. if (newExtension == ".mp4" || newExtension == ".m4v") { switch ((Mp4Behaviour)this.userSettingService.GetUserSetting <int>(UserSettingConstants.UseM4v)) { case Mp4Behaviour.Auto: // Auto newExtension = MP4Helper.RequiresM4v(this.Task) ? ".m4v" : ".mp4"; break; case Mp4Behaviour.MP4: // MP4 newExtension = ".mp4"; break; case Mp4Behaviour.M4V: // M4v newExtension = ".m4v"; break; } } // Now disable controls that are not required. The Following are for MP4 only! if (newExtension == ".mkv" || newExtension == ".webm") { this.OptimizeMP4 = false; this.IPod5GSupport = false; this.AlignAVStart = false; } if (!VideoEncoderHelpers.IsH264(this.task.VideoEncoder)) { this.IPod5GSupport = false; } this.NotifyOfPropertyChange(() => this.IsMkvOrWebm); this.NotifyOfPropertyChange(() => this.IsIpodAtomVisible); // Update The browse file extension display if (Path.HasExtension(newExtension)) { this.OnOutputFormatChanged(new OutputFormatChangedEventArgs(newExtension)); } // Update the UI Display this.NotifyOfPropertyChange(() => this.Task); }