diff options
author | Scott <[email protected]> | 2015-12-27 21:57:05 +0000 |
---|---|---|
committer | Scott <[email protected]> | 2015-12-27 21:57:05 +0000 |
commit | e2a5481e83511c59a3322eadab2e71b9f0796cb7 (patch) | |
tree | 971464d9cb8039e65c88aaae3a3a8b41b42d3c80 /win/CS/HandBrakeWPF/Helpers/MP4Helper.cs | |
parent | 930039b3154fcbf919b77ca0448865467e352896 (diff) |
WinGui: Some API and warnings cleanup.
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/MP4Helper.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Helpers/MP4Helper.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/MP4Helper.cs b/win/CS/HandBrakeWPF/Helpers/MP4Helper.cs new file mode 100644 index 000000000..78e3b5ee2 --- /dev/null +++ b/win/CS/HandBrakeWPF/Helpers/MP4Helper.cs @@ -0,0 +1,49 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="MP4Helper.cs" company="HandBrake Project (http://handbrake.fr)"> +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// </copyright> +// <summary> +// Defines the MP4Helper type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Helpers +{ + using System.Linq; + + using HandBrakeWPF.Services.Encode.Model; + using HandBrakeWPF.Services.Encode.Model.Models; + + /// <summary> + /// The MP4 Format helper class + /// </summary> + public class MP4Helper + { + /// <summary> + /// Gets a value indicating whether M4v extension is required. + /// </summary> + /// <param name="task"> + /// The task. + /// </param> + /// <returns> + /// The <see cref="bool"/> to indicate if this task requires m4v extension + /// </returns> + 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; + } + } +} |