// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // Defines the MP4Helper type. // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Helpers { using System.Linq; using HandBrakeWPF.Services.Encode.Model; using HandBrakeWPF.Services.Encode.Model.Models; /// /// The MP4 Format helper class /// public class MP4Helper { /// /// Gets a value indicating whether M4v extension is required. /// /// /// The task. /// /// /// The to indicate if this task requires m4v extension /// public static bool RequiresM4v(EncodeTask task) { if (task.OutputFormat == OutputFormat.Mp4) { bool audio = task.AudioTracks.Any( item => item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.Ac3 || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Passthrough); bool subtitles = task.SubtitleTracks.Any(track => track.SubtitleType != SubtitleType.VobSub); return audio || subtitles; } return false; } } }