/* QueryParser.cs $\r
- \r
- This file is part of the HandBrake source code.\r
- Homepage: <http://handbrake.m0k.org/>.\r
- It may be used under the terms of the GNU General Public License. */\r
-\r
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Text.RegularExpressions;\r
-using System.Windows.Forms;\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
\r
namespace Handbrake.Functions\r
{\r
- class QueryParser\r
+ using System;\r
+ using System.Collections;\r
+ using System.Globalization;\r
+ using System.Text.RegularExpressions;\r
+ using System.Windows.Forms;\r
+ using Model;\r
+\r
+ /// <summary>\r
+ /// Parse a CLI Query\r
+ /// </summary>\r
+ public class QueryParser\r
{\r
+ /// <summary>\r
+ /// The Culture\r
+ /// </summary>\r
+ private static readonly CultureInfo Culture = new CultureInfo("en-US", false);\r
\r
- // All the Main Window GUI options\r
#region Varibles\r
\r
- #region Source\r
- private string q_source;\r
+ #region Source Title / Chapters\r
/// <summary>\r
- /// Returns a String \r
- /// Full path of the source.\r
+ /// Gets or sets Title.\r
/// </summary>\r
- public string Source\r
- {\r
- get\r
- {\r
- return this.q_source;\r
- }\r
- }\r
- private int q_dvdTitle;\r
+ public int Title { get; set; }\r
+\r
/// <summary>\r
- /// Returns an Integer\r
- /// DVD Title number.\r
+ /// Gets or sets ChapterStart.\r
/// </summary>\r
- public int DVDTitle\r
- {\r
- get\r
- {\r
- return this.q_dvdTitle;\r
- }\r
- }\r
+ public int ChapterStart { get; set; }\r
\r
- private int q_chaptersStart;\r
/// <summary>\r
- /// Returns an Int\r
- /// DVD Chapter number or chapter range.\r
+ /// Gets or sets ChapterFinish.\r
/// </summary>\r
- public int DVDChapterStart\r
- {\r
- get\r
- {\r
- return this.q_chaptersStart;\r
- }\r
- }\r
+ public int ChapterFinish { get; set; }\r
+ #endregion\r
\r
- private int q_chaptersFinish;\r
+ #region Output Settings\r
/// <summary>\r
- /// Returns an Int\r
- /// DVD Chapter number or chapter range.\r
+ /// Gets or sets the file Format. e.g mkv or mp4\r
/// </summary>\r
- public int DVDChapterFinish\r
- {\r
- get\r
- {\r
- return this.q_chaptersFinish;\r
- }\r
- }\r
-#endregion\r
+ public string Format { get; set; }\r
\r
- #region Destination\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether LargeMP4 support is enabled.\r
+ /// This is the 64bit MP4 file that allows >4GB files\r
+ /// </summary>\r
+ public bool LargeMP4 { get; set; }\r
\r
- private string q_destination;\r
/// <summary>\r
- /// Returns a String \r
- /// Full path of the destination.\r
+ /// Gets or sets a value indicating whether IpodAtom is inserted\r
/// </summary>\r
- public string Destination\r
- {\r
- get\r
- {\r
- return this.q_destination;\r
- }\r
- }\r
+ public bool IpodAtom { get; set; }\r
\r
- private string q_format;\r
/// <summary>\r
- /// Returns a String \r
- /// Full path of the destination.\r
+ /// Gets or sets a value indicating whether OptimizeMP4 is enabed for web streaming\r
/// </summary>\r
- public string Format\r
- {\r
- get\r
- {\r
- return this.q_format;\r
- }\r
- }\r
+ public bool OptimizeMP4 { get; set; }\r
+ #endregion\r
+\r
+ #region Picture Settings\r
\r
- private string q_videoEncoder;\r
/// <summary>\r
- /// Returns an String\r
- /// The Video Encoder used.\r
+ /// Gets or sets Width.\r
/// </summary>\r
- public string VideoEncoder\r
- {\r
- get\r
- {\r
- return this.q_videoEncoder;\r
- }\r
- }\r
+ public int Width { get; set; }\r
\r
- private string q_audioEncoder;\r
/// <summary>\r
- /// Returns an String\r
- /// The Audio Encoder used.\r
+ /// Gets or sets Height.\r
/// </summary>\r
- public string AudioEncoder\r
- {\r
- get\r
- {\r
- return this.q_audioEncoder;\r
- }\r
- }\r
-#endregion\r
+ public int Height { get; set; }\r
\r
- #region Picture Settings\r
- private int q_videoWidth;\r
/// <summary>\r
- /// Returns an Int\r
- /// The selected Width for the encoding.\r
+ /// Gets or sets MaxWidth.\r
/// </summary>\r
- public int Width\r
- {\r
- get\r
- {\r
- return this.q_videoWidth;\r
- }\r
- }\r
+ public int MaxWidth { get; set; }\r
\r
- private int q_videoHeight;\r
/// <summary>\r
- /// Returns an Int\r
- /// The selected Height for the encoding.\r
+ /// Gets or sets MaxHeight.\r
/// </summary>\r
- public int Height\r
- {\r
- get\r
- {\r
- return this.q_videoHeight;\r
- }\r
- }\r
+ public int MaxHeight { get; set; }\r
\r
- private string q_cropValues;\r
/// <summary>\r
- /// Returns an String\r
- /// Cropping values.\r
+ /// Gets or sets CropValues.\r
/// </summary>\r
- public string CropValues\r
- {\r
- get\r
- {\r
- return this.q_cropValues;\r
- }\r
- }\r
+ public string CropValues { get; set; }\r
\r
- private string q_croptop;\r
/// <summary>\r
- /// Returns an String\r
- /// Cropping values.\r
+ /// Gets or sets CropTop.\r
/// </summary>\r
- public string CropTop\r
- {\r
- get\r
- {\r
- return this.q_croptop;\r
- }\r
- }\r
+ public string CropTop { get; set; }\r
\r
- private string q_cropbottom;\r
/// <summary>\r
- /// Returns an String\r
- /// Cropping values.\r
+ /// Gets or sets CropBottom.\r
/// </summary>\r
- public string CropBottom\r
- {\r
- get\r
- {\r
- return this.q_cropbottom;\r
- }\r
- }\r
+ public string CropBottom { get; set; }\r
\r
- private string q_cropLeft;\r
/// <summary>\r
- /// Returns an String\r
- /// Cropping values.\r
+ /// Gets or sets CropLeft.\r
/// </summary>\r
- public string CropLeft\r
- {\r
- get\r
- {\r
- return this.q_cropLeft;\r
- }\r
- }\r
+ public string CropLeft { get; set; }\r
\r
- private string q_cropRight;\r
/// <summary>\r
- /// Returns an String\r
- /// Cropping values.\r
+ /// Gets or sets CropRight.\r
/// </summary>\r
- public string CropRight\r
- {\r
- get\r
- {\r
- return this.q_cropRight;\r
- }\r
- }\r
+ public string CropRight { get; set; }\r
\r
- private Boolean q_detelecine;\r
/// <summary>\r
- /// Returns a boolean to indicate wither DeTelecine is on or off\r
+ /// Gets or sets AnamorphicMode.\r
/// </summary>\r
- public Boolean DeTelecine\r
- {\r
- get\r
- {\r
- return this.q_detelecine;\r
- }\r
- }\r
+ public int AnamorphicMode { get; set; }\r
\r
- private Boolean q_vfr;\r
/// <summary>\r
- /// Returns a boolean to indicate wither DeTelecine is on or off\r
+ /// Gets or sets a value indicating whether KeepDisplayAsect.\r
/// </summary>\r
- public Boolean VFR\r
- {\r
- get\r
- {\r
- return this.q_vfr;\r
- }\r
- }\r
+ public bool KeepDisplayAsect { get; set; }\r
\r
- private Boolean q_deBlock;\r
/// <summary>\r
- /// Returns a boolean to indicate wither DeBlock is on or off.\r
+ /// Gets or sets DisplayWidthValue.\r
/// </summary>\r
- public Boolean DeBlock\r
- {\r
- get\r
- {\r
- return this.q_deBlock;\r
- }\r
- }\r
+ public double DisplayWidthValue { get; set; }\r
\r
- private string q_deinterlace;\r
/// <summary>\r
- /// Returns a string with the De-Interlace option used.\r
+ /// Gets or sets PixelAspectWidth.\r
/// </summary>\r
- public string DeInterlace\r
- {\r
- get\r
- {\r
- return this.q_deinterlace;\r
- }\r
- }\r
+ public int PixelAspectWidth { get; set; }\r
\r
- private string q_denoise;\r
/// <summary>\r
- /// Returns a string with the DeNoise option used.\r
+ /// Gets or sets PixelAspectHeight.\r
/// </summary>\r
- public string DeNoise\r
- {\r
- get\r
- {\r
- return this.q_denoise;\r
- }\r
- }\r
+ public int PixelAspectHeight { get; set; }\r
\r
- private Boolean q_anamorphic;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Anamorphic is on or off.\r
+ /// Gets or sets AnamorphicModulus.\r
/// </summary>\r
- public Boolean Anamorphic\r
- {\r
- get\r
- {\r
- return this.q_anamorphic;\r
- }\r
- }\r
+ public int AnamorphicModulus { get; set; }\r
+ #endregion\r
+\r
+ #region Video Filters\r
\r
- private Boolean q_looseAnamorphic;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Anamorphic is on or off.\r
+ /// Gets or sets DeTelecine.\r
/// </summary>\r
- public Boolean LooseAnamorphic\r
- {\r
- get\r
- {\r
- return this.q_looseAnamorphic;\r
- }\r
- }\r
+ public string DeTelecine { get; set; }\r
\r
- private Boolean q_chapterMarkers;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Chapter Markers is on or off.\r
+ /// Gets or sets DeBlock.\r
/// </summary>\r
- public Boolean ChapterMarkers\r
- {\r
- get\r
- {\r
- return this.q_chapterMarkers;\r
- }\r
- }\r
- #endregion\r
+ public int DeBlock { get; set; }\r
\r
- #region Video Settings\r
- private Boolean q_grayscale;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Grayscale is on or off.\r
+ /// Gets or sets DeInterlace.\r
/// </summary>\r
- public Boolean Grayscale\r
- {\r
- get\r
- {\r
- return this.q_grayscale;\r
- }\r
- }\r
+ public string DeInterlace { get; set; }\r
\r
- private Boolean q_twoPass;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Two Pass Encoding is on or off.\r
+ /// Gets or sets DeNoise.\r
/// </summary>\r
- public Boolean TwoPass\r
- {\r
- get\r
- {\r
- return this.q_twoPass;\r
- }\r
- }\r
+ public string DeNoise { get; set; }\r
\r
- private Boolean q_turboFirst;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Chapter Markers is on or off.\r
+ /// Gets or sets Decomb.\r
/// </summary>\r
- public Boolean TurboFirstPass\r
- {\r
- get\r
- {\r
- return this.q_turboFirst;\r
- }\r
- }\r
+ public string Decomb { get; set; }\r
+ #endregion\r
\r
- private Boolean q_largeMp4;\r
+ #region Video Settings\r
/// <summary>\r
- /// Returns a boolean to indicate wither Larger MP4 files is on or off.\r
+ /// Gets or sets VideoEncoder.\r
/// </summary>\r
- public Boolean LargeMP4\r
- {\r
- get\r
- {\r
- return this.q_largeMp4;\r
- }\r
- }\r
+ public string VideoEncoder { get; set; }\r
\r
- private Boolean q_ipodAtom;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Larger MP4 files is on or off.\r
+ /// Gets or sets a value indicating whether Grayscale.\r
/// </summary>\r
- public Boolean IpodAtom\r
- {\r
- get\r
- {\r
- return this.q_ipodAtom;\r
- }\r
- }\r
+ public bool Grayscale { get; set; }\r
\r
- private Boolean q_optimizeMp4;\r
/// <summary>\r
- /// Returns a boolean to indicate wither Larger MP4 files is on or off.\r
+ /// Gets or sets a value indicating whether TwoPass.\r
/// </summary>\r
- public Boolean OptimizeMP4\r
- {\r
- get\r
- {\r
- return this.q_optimizeMp4;\r
- }\r
- }\r
+ public bool TwoPass { get; set; }\r
\r
- private string q_videoFramerate;\r
/// <summary>\r
- /// Returns a string with the video Framerate\r
+ /// Gets or sets a value indicating whether TurboFirstPass.\r
/// </summary>\r
- public string VideoFramerate\r
- {\r
- get\r
- {\r
- return this.q_videoFramerate;\r
- }\r
- }\r
+ public bool TurboFirstPass { get; set; }\r
\r
- private string q_avgBitrate;\r
/// <summary>\r
- /// Returns a string with the average video bitrate\r
+ /// Gets or sets VideoFramerate.\r
/// </summary>\r
- public string AverageVideoBitrate\r
- {\r
- get\r
- {\r
- return this.q_avgBitrate;\r
- }\r
- }\r
+ public string VideoFramerate { get; set; }\r
\r
- private string q_videoTargetSize;\r
/// <summary>\r
- /// Returns a string with the video target size\r
+ /// Gets or sets AverageVideoBitrate.\r
/// </summary>\r
- public string VideoTargetSize\r
- {\r
- get\r
- {\r
- return this.q_videoTargetSize;\r
- }\r
- }\r
+ public string AverageVideoBitrate { get; set; }\r
\r
- private int q_videoQuality;\r
/// <summary>\r
- /// Returns a int with the video quality value\r
+ /// Gets or sets VideoTargetSize.\r
/// </summary>\r
- public int VideoQuality\r
- {\r
- get\r
- {\r
- return this.q_videoQuality;\r
- }\r
- }\r
+ public string VideoTargetSize { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets VideoQuality.\r
+ /// </summary>\r
+ public float VideoQuality { get; set; }\r
#endregion\r
\r
#region Audio Settings\r
- private string q_audioBitrate;\r
+\r
/// <summary>\r
- /// Returns a string with the audio bitrate\r
+ /// Gets or sets AudioInformation.\r
/// </summary>\r
- public string AudioBitrate\r
- {\r
- get\r
- {\r
- return this.q_audioBitrate;\r
- }\r
- }\r
+ public ArrayList AudioInformation { get; set; }\r
\r
- private string q_audioSamplerate;\r
/// <summary>\r
- /// Returns a string with the audio sample rate\r
+ /// Gets or sets Subtitles.\r
/// </summary>\r
- public string AudioSampleBitrate\r
- {\r
- get\r
- {\r
- return this.q_audioSamplerate;\r
- }\r
- }\r
+ public string Subtitles { get; set; }\r
\r
- private string q_audioTrack1;\r
/// <summary>\r
- /// Returns a string with the First selected Audio track\r
+ /// Gets or sets a value indicating whether ForcedSubtitles.\r
/// </summary>\r
- public string AudioTrack1\r
- {\r
- get\r
- {\r
- return this.q_audioTrack1;\r
- }\r
- }\r
+ public bool ForcedSubtitles { get; set; }\r
+ #endregion\r
\r
- private string q_audioTrack2;\r
+ #region Other\r
/// <summary>\r
- /// Returns a string with the First selected Audio track\r
+ /// Gets or sets a value indicating whether ChapterMarkers.\r
/// </summary>\r
- public string AudioTrack2\r
- {\r
- get\r
- {\r
- return this.q_audioTrack2;\r
- }\r
- }\r
+ public bool ChapterMarkers { get; set; }\r
\r
- private string q_audioTrackMix;\r
/// <summary>\r
- /// Returns a string with the First selected Audio track Mix\r
+ /// Gets or sets H264Query.\r
/// </summary>\r
- public string AudioTrackMix\r
- {\r
- get\r
- {\r
- return this.q_audioTrackMix;\r
- }\r
- }\r
+ public string H264Query { get; set; }\r
\r
- private double q_drc;\r
/// <summary>\r
- /// Returns a string with the selected subtitle track\r
+ /// Gets or sets a value indicating whether Verbose.\r
/// </summary>\r
- public double DRC\r
- {\r
- get\r
- {\r
- return this.q_drc;\r
- }\r
- }\r
+ public bool Verbose { get; set; }\r
+ #endregion\r
\r
+ #region Preset Information\r
\r
- private string q_subtitles;\r
/// <summary>\r
- /// Returns a string with the selected subtitle track\r
+ /// Gets or sets PresetBuildNumber.\r
/// </summary>\r
- public string Subtitles\r
- {\r
- get\r
- {\r
- return this.q_subtitles;\r
- }\r
- }\r
+ public int PresetBuildNumber { get; set; }\r
\r
- private Boolean q_forcedSubs;\r
/// <summary>\r
- /// Returns a string with the selected subtitle track\r
+ /// Gets or sets PresetDescription.\r
/// </summary>\r
- public Boolean ForcedSubtitles\r
- {\r
- get\r
- {\r
- return this.q_forcedSubs;\r
- }\r
- }\r
+ public string PresetDescription { get; set; }\r
\r
- #endregion\r
+ /// <summary>\r
+ /// Gets or sets PresetName.\r
+ /// </summary>\r
+ public string PresetName { get; set; }\r
\r
- #region Other\r
- private string q_h264;\r
/// <summary>\r
- /// Returns a string with the Advanced H264 query string\r
+ /// Gets or sets Type.\r
/// </summary>\r
- public string H264Query\r
- {\r
- get\r
- {\r
- return this.q_h264;\r
- }\r
- }\r
- private Boolean q_verbose;\r
+ public string Type { get; set; }\r
+\r
/// <summary>\r
- /// Returns a string with the Advanced H264 query string\r
+ /// Gets or sets a value indicating whether UsesMaxPictureSettings.\r
/// </summary>\r
- public Boolean Verbose\r
- {\r
- get\r
- {\r
- return this.q_verbose;\r
- }\r
- }\r
+ public bool UsesMaxPictureSettings { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether UsesPictureFilters.\r
+ /// </summary>\r
+ public bool UsesPictureFilters { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether UsesPictureSettings.\r
+ /// </summary>\r
+ public bool UsesPictureSettings { get; set; }\r
#endregion\r
\r
#endregion\r
\r
- // Takes in a query which can be in any order and parses it. All varibles are then set so they can be used elsewhere.\r
- public static QueryParser Parse(String input)\r
+ /// <summary>\r
+ /// Takes in a query which can be in any order and parses it. \r
+ /// All varibles are then set so they can be used elsewhere.\r
+ /// </summary>\r
+ /// <param name="input">A ClI Query</param>\r
+ /// <returns>A Parsed Query</returns>\r
+ public static QueryParser Parse(string input)\r
{\r
- QueryParser thisQuery = new QueryParser();\r
+ var thisQuery = new QueryParser();\r
\r
- #region reg exp\r
- //Source\r
- Regex r1 = new Regex(@"(-i)(?:\s\"")([a-zA-Z0-9:\\\s\.]+)(?:\"")");\r
- Match source = r1.Match(input.Replace('"', '\"'));\r
+ #region Regular Expressions\r
+\r
+ // Source\r
Match title = Regex.Match(input, @"-t ([0-9]*)");\r
Match chapters = Regex.Match(input, @"-c ([0-9-]*)");\r
+\r
+ // Output Settings\r
Match format = Regex.Match(input, @"-f ([a-z0-9a-z0-9a-z0-9]*)");\r
+ Match grayscale = Regex.Match(input, @" -g");\r
+ Match largerMp4 = Regex.Match(input, @" -4");\r
+ Match ipodAtom = Regex.Match(input, @" -I");\r
\r
- //Destination\r
- Regex r2 = new Regex(@"(-o)(?:\s\"")([a-zA-Z0-9:\\\s\.]+)(?:\"")");\r
- Match destination = r2.Match(input.Replace('"', '\"'));\r
+ // Picture Settings Tab\r
Match width = Regex.Match(input, @"-w ([0-9]*)");\r
Match height = Regex.Match(input, @"-l ([0-9]*)");\r
- Match videoEncoder = Regex.Match(input, @"-e ([a-zA-Z0-9]*)");\r
- Match audioEncoder = Regex.Match(input, @"-E ([a-zA-Z0-9]*)");\r
-\r
- //Picture Settings Tab\r
- Match deinterlace = Regex.Match(input, @"--deinterlace=([a-z]*)");\r
- Match denoise = Regex.Match(input, @"--denoise=([a-z]*)");\r
- Match deblock = Regex.Match(input, @"--deblock");\r
+ Match maxWidth = Regex.Match(input, @"-X ([0-9]*)");\r
+ Match maxHeight = Regex.Match(input, @"-Y ([0-9]*)");\r
+ Match crop = Regex.Match(input, @"--crop ([0-9]*):([0-9]*):([0-9]*):([0-9]*)");\r
+\r
+ Match looseAnamorphic = Regex.Match(input, @"--loose-anamorphic");\r
+ Match strictAnamorphic = Regex.Match(input, @"--strict-anamorphic");\r
+ Match customAnamorphic = Regex.Match(input, @"--custom-anamorphic");\r
+\r
+ Match keepDisplayAsect = Regex.Match(input, @"--keep-display-aspect");\r
+ Match displayWidth = Regex.Match(input, @"--display-width ([0-9]*)");\r
+ Match pixelAspect = Regex.Match(input, @"--pixel-aspect ([0-9]*):([0-9]*)");\r
+ Match modulus = Regex.Match(input, @"--modulus ([0-9]*)");\r
+\r
+ // Picture Settings - Filters\r
+ Match decomb = Regex.Match(input, @" --decomb");\r
+ Match decombValue = Regex.Match(input, @" --decomb=\""([a-zA-Z0-9.:]*)\""");\r
+ Match deinterlace = Regex.Match(input, @"--deinterlace=\""([a-zA-Z0-9.:]*)\""");\r
+ Match denoise = Regex.Match(input, @"--denoise=\""([a-zA-Z0-9.:]*)\""");\r
+ Match deblock = Regex.Match(input, @"--deblock=([0-9:]*)");\r
Match detelecine = Regex.Match(input, @"--detelecine");\r
- Match anamorphic = Regex.Match(input, @"-p ");\r
- Match chapterMarkers = Regex.Match(input, @"-m");\r
- Match crop = Regex.Match(input, @"--crop ([0-9]):([0-9]):([0-9]):([0-9])");\r
- Match vfr = Regex.Match(input, @"-V");\r
- Match lanamorphic = Regex.Match(input, @"-P");\r
-\r
- //Video Settings Tab\r
- Match videoFramerate = Regex.Match(input, @"-r ([0-9]*)");\r
+ Match detelecineValue = Regex.Match(input, @" --detelecine=\""([a-zA-Z0-9.:]*)\""");\r
+\r
+ // Video Settings Tab\r
+ Match videoEncoder = Regex.Match(input, @"-e ([a-zA-Z0-9]*)");\r
+ Match videoFramerate = Regex.Match(input, @"-r ([0-9.]*)");\r
Match videoBitrate = Regex.Match(input, @"-b ([0-9]*)");\r
Match videoQuality = Regex.Match(input, @"-q ([0-9.]*)");\r
Match videoFilesize = Regex.Match(input, @"-S ([0-9.]*)");\r
- Match twoPass = Regex.Match(input, @"-2");\r
- Match turboFirstPass = Regex.Match(input, @"-T");\r
- Match grayscale = Regex.Match(input, @"-g");\r
- Match largerMp4 = Regex.Match(input, @"-4");\r
- Match ipodAtom = Regex.Match(input, @"-I");\r
- Match optimizeMP4 = Regex.Match(input, @"-O");\r
-\r
- //Audio Settings Tab\r
+ Match twoPass = Regex.Match(input, @" -2");\r
+ Match turboFirstPass = Regex.Match(input, @" -T");\r
+ Match optimizeMP4 = Regex.Match(input, @" -O");\r
+\r
+ // Audio Settings Tab\r
+ Match noAudio = Regex.Match(input, @"-a none");\r
+ Match audioTracks = Regex.Match(input, @"-a ([0-9,]*)");\r
+ Match audioTrackMixes = Regex.Match(input, @"-6 ([0-9a-zA-Z,]*)");\r
+ Match audioEncoders = Regex.Match(input, @"-E ([a-zA-Z0-9+,]*)");\r
+ Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]*)"); // Auto = a-z\r
+ Match audioSampleRates = Regex.Match(input, @"-R ([0-9a-zA-Z.,]*)"); // Auto = a-z\r
+ Match drcValues = Regex.Match(input, @"-D ([0-9.,]*)");\r
+\r
Match subtitles = Regex.Match(input, @"-s ([0-9a-zA-Z]*)");\r
- Match subScan = Regex.Match(input, @"-U");\r
- Match audioBitrate = Regex.Match(input, @"-B ([0-9]*)");\r
- Match audioSampleRate = Regex.Match(input, @"-R ([0-9.]*)");\r
- Match audioChannelsMix = Regex.Match(input, @"-6 ([0-9a-z0-9]*)"); // 1 -6 dpl2 // Broken\r
- Match audioTrack1 = Regex.Match(input, @"-a ([0-9]*)");\r
- Match audioTrack2 = Regex.Match(input, @"-a ([0-9]*),([0-9]*)");\r
- Match forcedSubtitles = Regex.Match(input, @"-F");\r
- Match drc = Regex.Match(input, @"-D ([0-9.]*)");\r
-\r
- //H264 Tab\r
- Match x264 = Regex.Match(input, @"-x ([,a-zA-Z0-9=:-]*)");\r
-\r
- //Program Options\r
- Match verbose = Regex.Match(input, @"-v");\r
+ Match subScan = Regex.Match(input, @" -U");\r
+ Match forcedSubtitles = Regex.Match(input, @" -F");\r
+\r
+ // Chapters Tab\r
+ Match chapterMarkers = Regex.Match(input, @" -m");\r
+ Match chapterMarkersFileMode = Regex.Match(input, @"--markers");\r
+\r
+ // H264 Tab\r
+ Match x264 = Regex.Match(input, @"-x ([.,/a-zA-Z0-9=:-]*)");\r
+\r
+ // Program Options\r
+ Match verbose = Regex.Match(input, @" -v");\r
+\r
#endregion\r
\r
+ #region Set Varibles\r
+\r
try\r
{\r
- //\r
- // Source\r
- //\r
#region Source Tab\r
\r
- thisQuery.q_source = source.ToString().Replace("-i ", "").Replace("\"", "");\r
- if (title.Success != false)\r
- thisQuery.q_dvdTitle = int.Parse(title.ToString().Replace("-t ", ""));\r
+ if (title.Success)\r
+ thisQuery.Title = int.Parse(title.ToString().Replace("-t ", string.Empty));\r
\r
- if (chapters.Success != false)\r
+ if (chapters.Success)\r
{\r
- string[] actTitles = new string[2];\r
- actTitles = chapters.ToString().Replace("-c ", "").Split('-');\r
- thisQuery.q_chaptersStart = int.Parse(actTitles[0]);\r
+ string[] actTitles = chapters.ToString().Replace("-c ", string.Empty).Split('-');\r
+ thisQuery.ChapterStart = int.Parse(actTitles[0]);\r
if (actTitles.Length > 1)\r
{\r
- thisQuery.q_chaptersFinish = int.Parse(actTitles[1]);\r
+ thisQuery.ChapterFinish = int.Parse(actTitles[1]);\r
}\r
\r
- if ((thisQuery.q_chaptersStart == 1) && (thisQuery.q_chaptersFinish == 0))\r
- thisQuery.q_chaptersFinish = thisQuery.q_chaptersStart;\r
+ if ((thisQuery.ChapterStart == 1) && (thisQuery.ChapterFinish == 0))\r
+ thisQuery.ChapterFinish = thisQuery.ChapterStart;\r
}\r
\r
- if (format.Success != false)\r
- thisQuery.q_format = format.ToString().Replace("-f ", "");\r
+ #endregion\r
+\r
+ #region Output Settings\r
+\r
+ if (format.Success)\r
+ thisQuery.Format = format.ToString().Replace("-f ", string.Empty);\r
+ thisQuery.LargeMP4 = largerMp4.Success;\r
+ thisQuery.IpodAtom = ipodAtom.Success;\r
+ thisQuery.OptimizeMP4 = optimizeMP4.Success;\r
\r
#endregion\r
\r
- //\r
- // Destination\r
- //\r
- #region Destination\r
- thisQuery.q_destination = destination.ToString().Replace("-o ", "").Replace("\"", "");\r
+ #region Picture Tab\r
\r
- string videoEncoderConvertion;\r
- string audioEncoderConvertion;\r
+ if (width.Success)\r
+ thisQuery.Width = int.Parse(width.Groups[0].Value.Replace("-w ", string.Empty));\r
\r
- videoEncoderConvertion = videoEncoder.ToString().Replace("-e ", "");\r
- switch (videoEncoderConvertion)\r
- {\r
- case "ffmpeg":\r
- videoEncoderConvertion = "Mpeg 4";\r
- break;\r
- case "xvid":\r
- videoEncoderConvertion = "Xvid";\r
- break;\r
- case "x264":\r
- videoEncoderConvertion = "H.264";\r
- break;\r
- case "x264b13":\r
- videoEncoderConvertion = "H.264 Baseline 1.3";\r
- break;\r
- case "x264b30":\r
- videoEncoderConvertion = "H.264 (iPod)";\r
- break;\r
- default:\r
- videoEncoderConvertion = "Mpeg 4";\r
- break;\r
- }\r
- thisQuery.q_videoEncoder = videoEncoderConvertion;\r
+ if (height.Success)\r
+ thisQuery.Height = int.Parse(height.Groups[0].Value.Replace("-l ", string.Empty));\r
+\r
+ if (maxWidth.Success)\r
+ thisQuery.MaxWidth = int.Parse(maxWidth.Groups[0].Value.Replace("-X ", string.Empty));\r
\r
- audioEncoderConvertion = audioEncoder.ToString().Replace("-E ", "");\r
- switch (audioEncoderConvertion)\r
+ if (maxHeight.Success)\r
+ thisQuery.MaxHeight = int.Parse(maxHeight.Groups[0].Value.Replace("-Y ", string.Empty));\r
+\r
+ if (crop.Success)\r
{\r
- case "faac":\r
- audioEncoderConvertion = "AAC";\r
- break;\r
- case "lame":\r
- audioEncoderConvertion = "MP3";\r
- break;\r
- case "vorbis":\r
- audioEncoderConvertion = "Vorbis";\r
- break;\r
- case "ac3":\r
- audioEncoderConvertion = "AC3";\r
- break;\r
- default:\r
- audioEncoderConvertion = "AAC";\r
- break;\r
+ thisQuery.CropValues = crop.ToString().Replace("--crop ", string.Empty);\r
+ string[] actCropValues = thisQuery.CropValues.Split(':');\r
+ thisQuery.CropTop = actCropValues[0];\r
+ thisQuery.CropBottom = actCropValues[1];\r
+ thisQuery.CropLeft = actCropValues[2];\r
+ thisQuery.CropRight = actCropValues[3];\r
}\r
- thisQuery.q_audioEncoder = audioEncoderConvertion;\r
\r
+ if (strictAnamorphic.Success)\r
+ thisQuery.AnamorphicMode = 1;\r
+ else if (looseAnamorphic.Success)\r
+ thisQuery.AnamorphicMode = 2;\r
+ else if (customAnamorphic.Success)\r
+ thisQuery.AnamorphicMode = 3;\r
+ else\r
+ thisQuery.AnamorphicMode = 0;\r
+\r
+ thisQuery.KeepDisplayAsect = keepDisplayAsect.Success;\r
+\r
+ if (displayWidth.Success)\r
+ thisQuery.DisplayWidthValue =\r
+ double.Parse(displayWidth.Groups[0].Value.Replace("--display-width ", string.Empty));\r
\r
- if (width.Success != false)\r
- thisQuery.q_videoWidth = int.Parse(width.ToString().Replace("-w ", ""));\r
+ if (pixelAspect.Success)\r
+ thisQuery.PixelAspectWidth = int.Parse(pixelAspect.Groups[1].Value.Replace("--pixel-aspect ", string.Empty));\r
\r
- if (height.Success != false)\r
- thisQuery.q_videoHeight = int.Parse(height.ToString().Replace("-l ", ""));\r
+ if (pixelAspect.Success && pixelAspect.Groups.Count >= 3)\r
+ thisQuery.PixelAspectHeight = int.Parse(pixelAspect.Groups[2].Value.Replace("--pixel-aspect ", string.Empty));\r
+\r
+ if (modulus.Success)\r
+ thisQuery.AnamorphicModulus = int.Parse(modulus.Groups[0].Value.Replace("--modulus ", string.Empty));\r
\r
#endregion\r
\r
- //\r
- //Picture Settings Tab\r
- //\r
- #region Picture Tab\r
- if (crop.Success != false)\r
+ #region Filters\r
+\r
+ thisQuery.Decomb = "Off";\r
+ if (decomb.Success)\r
{\r
- thisQuery.q_cropValues = crop.ToString().Replace("--crop ", "");\r
- string[] actCropValues = new string[3];\r
- actCropValues = thisQuery.q_cropValues.Split(':');\r
- thisQuery.q_croptop = actCropValues[0];\r
- thisQuery.q_cropbottom = actCropValues[1];\r
- thisQuery.q_cropLeft = actCropValues[2];\r
- thisQuery.q_cropRight = actCropValues[3];\r
+ thisQuery.Decomb = "Default";\r
+ if (decombValue.Success)\r
+ thisQuery.Decomb = decombValue.ToString().Replace("--decomb=", string.Empty).Replace("\"", string.Empty);\r
}\r
\r
- thisQuery.q_detelecine = detelecine.Success;\r
- thisQuery.q_deBlock = deblock.Success;\r
-\r
- thisQuery.q_deinterlace = "None";\r
- if (deinterlace.Success != false)\r
+ thisQuery.DeInterlace = "Off";\r
+ if (deinterlace.Success)\r
{\r
- switch (deinterlace.ToString().Replace("--deinterlace=", ""))\r
- {\r
- case "fast":\r
- thisQuery.q_deinterlace = "Fast";\r
- break;\r
- case "slow":\r
- thisQuery.q_deinterlace = "Slow";\r
- break;\r
- case "slower":\r
- thisQuery.q_deinterlace = "Slower";\r
- break;\r
- case "slowest":\r
- thisQuery.q_deinterlace = "Slowest";\r
- break;\r
- default:\r
- thisQuery.q_deinterlace = "None";\r
- break;\r
- }\r
+ thisQuery.DeInterlace = deinterlace.ToString().Replace("--deinterlace=", string.Empty).Replace("\"", string.Empty);\r
+ thisQuery.DeInterlace =\r
+ thisQuery.DeInterlace.Replace("fast", "Fast").Replace("slow", "Slow").Replace("slower", "Slower");\r
+ thisQuery.DeInterlace = thisQuery.DeInterlace.Replace("slowest", "Slowest");\r
}\r
\r
- thisQuery.q_denoise = "None";\r
- if (denoise.Success != false)\r
+ thisQuery.DeNoise = "Off";\r
+ if (denoise.Success)\r
{\r
- switch (denoise.ToString().Replace("--denoise=", ""))\r
- {\r
- case "weak":\r
- thisQuery.q_denoise = "Weak";\r
- break;\r
- case "medium":\r
- thisQuery.q_denoise = "Medium";\r
- break;\r
- case "strong":\r
- thisQuery.q_denoise = "Strong";\r
- break;\r
- default:\r
- thisQuery.q_denoise = "None";\r
- break;\r
- }\r
-\r
+ thisQuery.DeNoise = denoise.ToString().Replace("--denoise=", string.Empty).Replace("\"", string.Empty);\r
+ thisQuery.DeNoise =\r
+ thisQuery.DeNoise.Replace("weak", "Weak").Replace("medium", "Medium").Replace("strong", "Strong");\r
}\r
- thisQuery.q_anamorphic = anamorphic.Success;\r
- thisQuery.q_chapterMarkers = chapterMarkers.Success;\r
- thisQuery.q_vfr = vfr.Success;\r
- thisQuery.q_looseAnamorphic = lanamorphic.Success;\r
\r
- #endregion\r
-\r
- //\r
- //Video Settings Tab\r
- //\r
- #region Video\r
- thisQuery.q_grayscale = grayscale.Success;\r
- thisQuery.q_twoPass = twoPass.Success;\r
- thisQuery.q_turboFirst = turboFirstPass.Success;\r
- thisQuery.q_largeMp4 = largerMp4.Success;\r
- if (videoFramerate.Success != false)\r
- thisQuery.q_videoFramerate = videoFramerate.ToString().Replace("-r ", "");\r
- else\r
- thisQuery.q_videoFramerate = "Automatic";\r
+ string deblockValue = string.Empty;\r
+ thisQuery.DeBlock = 0;\r
+ if (deblock.Success)\r
+ deblockValue = deblock.ToString().Replace("--deblock=", string.Empty);\r
\r
- if (videoBitrate.Success != false)\r
- thisQuery.q_avgBitrate = videoBitrate.ToString().Replace("-b ", "");\r
- if (videoFilesize.Success != false)\r
- thisQuery.q_videoTargetSize = videoFilesize.ToString().Replace("-S ", "");\r
+ int dval = 0;\r
+ if (deblockValue != string.Empty)\r
+ int.TryParse(deblockValue, out dval);\r
+ thisQuery.DeBlock = dval;\r
\r
- double qConvert = 0;\r
- if (videoQuality.Success != false)\r
+ thisQuery.DeTelecine = "Off";\r
+ if (detelecine.Success)\r
{\r
- qConvert = double.Parse(videoQuality.ToString().Replace("-q ", "")) * 100;\r
- qConvert = System.Math.Ceiling(qConvert);\r
- thisQuery.q_videoQuality = int.Parse(qConvert.ToString());\r
+ thisQuery.DeTelecine = "Default";\r
+ if (detelecineValue.Success)\r
+ thisQuery.DeTelecine = detelecineValue.ToString().Replace("--detelecine=", string.Empty).Replace("\"", string.Empty);\r
}\r
- thisQuery.q_ipodAtom = ipodAtom.Success;\r
- thisQuery.q_optimizeMp4 = optimizeMP4.Success;\r
\r
#endregion\r
\r
- //\r
- //Audio Settings Tab\r
- //\r
- #region Audio\r
- if (audioBitrate.Success != false)\r
- thisQuery.q_audioBitrate = audioBitrate.ToString().Replace("-B ", "");\r
+ #region Video Settings Tab\r
\r
- if (audioSampleRate.Success != false)\r
- thisQuery.q_audioSamplerate = audioSampleRate.ToString().Replace("-R ", "");\r
-\r
- if (audioTrack1.Success != false)\r
- thisQuery.q_audioTrack1 = audioTrack1.ToString().Replace("-a ", "");\r
- else\r
- thisQuery.q_audioTrack1 = "Automatic";\r
-\r
- if (audioTrack2.Success != false)\r
+ string videoEncoderConvertion = videoEncoder.ToString().Replace("-e ", string.Empty);\r
+ switch (videoEncoderConvertion)\r
{\r
- string[] audioChan = audioTrack2.ToString().Split(',');\r
- thisQuery.q_audioTrack2 = audioChan[1];\r
+ case "ffmpeg":\r
+ videoEncoderConvertion = "MPEG-4 (FFmpeg)";\r
+ break;\r
+ case "x264":\r
+ videoEncoderConvertion = "H.264 (x264)";\r
+ break;\r
+ case "theora":\r
+ videoEncoderConvertion = "VP3 (Theora)";\r
+ break;\r
+ default:\r
+ videoEncoderConvertion = "MPEG-4 (FFmpeg)";\r
+ break;\r
}\r
- else\r
- thisQuery.q_audioTrack2 = "None";\r
-\r
- thisQuery.q_audioTrackMix = "Automatic";\r
- if (audioChannelsMix.Success != false)\r
+ thisQuery.VideoEncoder = videoEncoderConvertion;\r
+ thisQuery.VideoFramerate = videoFramerate.Success\r
+ ? videoFramerate.ToString().Replace("-r ", string.Empty)\r
+ : "Same as source";\r
+ thisQuery.Grayscale = grayscale.Success;\r
+ thisQuery.TwoPass = twoPass.Success;\r
+ thisQuery.TurboFirstPass = turboFirstPass.Success;\r
+\r
+ if (videoBitrate.Success)\r
+ thisQuery.AverageVideoBitrate = videoBitrate.ToString().Replace("-b ", string.Empty);\r
+ if (videoFilesize.Success)\r
+ thisQuery.VideoTargetSize = videoFilesize.ToString().Replace("-S ", string.Empty);\r
+\r
+ if (videoQuality.Success)\r
{\r
- switch (audioChannelsMix.ToString().Replace("-6 ", "").Replace(" ", ""))\r
- {\r
- case "mono":\r
- thisQuery.q_audioTrackMix = "Mono";\r
- break;\r
- case "stereo":\r
- thisQuery.q_audioTrackMix = "Stereo";\r
- break;\r
- case "dpl1":\r
- thisQuery.q_audioTrackMix = "Dolby Surround";\r
- break;\r
- case "dpl2":\r
- thisQuery.q_audioTrackMix = "Dolby Pro Logic II";\r
- break;\r
- case "6ch":\r
- thisQuery.q_audioTrackMix = "6 Channel Discrete";\r
- break;\r
- default:\r
- thisQuery.q_audioTrackMix = "Automatic";\r
- break;\r
- }\r
-\r
+ float qConvert = float.Parse(videoQuality.ToString().Replace("-q ", string.Empty), Culture);\r
+ thisQuery.VideoQuality = qConvert;\r
}\r
- if (subtitles.Success != false)\r
- thisQuery.q_subtitles = subtitles.ToString().Replace("-s ", "");\r
else\r
+ thisQuery.VideoQuality = -1;\r
+\r
+ #endregion\r
+\r
+ #region Audio Tab\r
+\r
+ // Find out how many tracks we need to add by checking how many encoders or audio tracks are selected.\r
+ int encoderCount = 0;\r
+ if (audioEncoders.Success)\r
{\r
- if (subScan.Success)\r
- thisQuery.q_subtitles = "Autoselect";\r
- else\r
- thisQuery.q_subtitles = "None";\r
+ string[] audioDataCounters = audioEncoders.ToString().Replace("-E ", string.Empty).Split(',');\r
+ encoderCount = audioDataCounters.Length;\r
}\r
\r
- if (drc.Success != false)\r
+ // Get the data from the regular expression results\r
+ string[] trackData = null;\r
+ string[] trackMixes = null;\r
+ string[] trackEncoders = null;\r
+ string[] trackBitrates = null;\r
+ string[] trackSamplerates = null;\r
+ string[] trackDRCvalues = null;\r
+\r
+ if (audioTracks.Success)\r
+ trackData = audioTracks.ToString().Replace("-a ", string.Empty).Split(',');\r
+ if (audioTrackMixes.Success)\r
+ trackMixes = audioTrackMixes.ToString().Replace("-6 ", string.Empty).Split(',');\r
+ if (audioEncoders.Success)\r
+ trackEncoders = audioEncoders.ToString().Replace("-E ", string.Empty).Split(',');\r
+ if (audioBitrates.Success)\r
+ trackBitrates = audioBitrates.ToString().Replace("-B ", string.Empty).Split(',');\r
+ if (audioSampleRates.Success)\r
+ trackSamplerates = audioSampleRates.ToString().Replace("-R ", string.Empty).Split(',');\r
+ if (drcValues.Success)\r
+ trackDRCvalues = drcValues.ToString().Replace("-D ", string.Empty).Split(',');\r
+\r
+ // Create new Audio Track Classes and store them in the ArrayList\r
+ ArrayList allAudioTrackInfo = new ArrayList();\r
+ for (int x = 0; x < encoderCount; x++)\r
{\r
- string value = drc.ToString().Replace("-D ", "");\r
- float drcValue = float.Parse(value);\r
- drcValue = drcValue * 10;\r
- thisQuery.q_drc = drcValue;\r
+ AudioTrack track = new AudioTrack();\r
+ if (trackData != null)\r
+ if (trackData.Length >= (x + 1)) // Audio Track\r
+ track.Track = trackData[x].Trim();\r
+\r
+ if (trackMixes != null)\r
+ if (trackMixes.Length >= (x + 1)) // Audio Mix\r
+ track.MixDown = GetMixDown(trackMixes[x].Trim());\r
+\r
+ if (trackEncoders != null)\r
+ if (trackEncoders.Length >= (x + 1)) // Audio Mix\r
+ track.Encoder = GetAudioEncoder(trackEncoders[x].Trim());\r
+\r
+ if (trackBitrates != null)\r
+ if (trackBitrates.Length >= (x + 1)) // Audio Encoder\r
+ track.Bitrate = trackBitrates[x].Trim() == "auto" ? "Auto" : trackBitrates[x].Trim();\r
+\r
+ if (trackSamplerates != null)\r
+ if (trackSamplerates.Length >= (x + 1)) // Audio SampleRate\r
+ track.SampleRate = trackSamplerates[x].Trim() == "0" ? "Auto" : trackSamplerates[x].Trim();\r
+\r
+ if (trackDRCvalues != null)\r
+ if (trackDRCvalues.Length >= (x + 1)) // Audio DRC Values\r
+ track.DRC = trackDRCvalues[x].Trim();\r
+\r
+ allAudioTrackInfo.Add(track);\r
}\r
+ thisQuery.AudioInformation = allAudioTrackInfo;\r
+\r
+ // Subtitle Stuff\r
+ if (subtitles.Success)\r
+ thisQuery.Subtitles = subtitles.ToString().Replace("-s ", string.Empty);\r
else\r
- {\r
- thisQuery.q_drc = 0;\r
- }\r
+ thisQuery.Subtitles = subScan.Success ? "Autoselect" : "None";\r
\r
- thisQuery.q_forcedSubs = forcedSubtitles.Success;\r
+ thisQuery.ForcedSubtitles = forcedSubtitles.Success;\r
\r
#endregion\r
\r
- //\r
- //H264 tab and other \r
- //\r
- #region h264 and other\r
- //\r
- //H264 Tab\r
- //\r
- if (x264.Success != false)\r
- {\r
- thisQuery.q_h264 = x264.ToString().Replace("-x ", "");\r
- }\r
+ #region Chapters Tab\r
+\r
+ if (chapterMarkersFileMode.Success || chapterMarkers.Success)\r
+ thisQuery.ChapterMarkers = true;\r
+\r
+ #endregion\r
+\r
+ #region H.264 and other\r
+\r
+ if (x264.Success)\r
+ thisQuery.H264Query = x264.ToString().Replace("-x ", string.Empty);\r
+\r
+ thisQuery.Verbose = verbose.Success;\r
\r
- //\r
- //Progam Options\r
- //\r
- thisQuery.q_verbose = verbose.Success;\r
#endregion\r
}\r
catch (Exception exc)\r
{\r
- MessageBox.Show("An error has occured in the Query Parser. Please report this error on the forum in the 'Windows' support section. \n\n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ frmExceptionWindow exceptionWindow = new frmExceptionWindow();\r
+ exceptionWindow.Setup("An error has occured in the Query Parser.", exc.ToString());\r
+ exceptionWindow.ShowDialog();\r
}\r
\r
+ #endregion\r
+\r
return thisQuery;\r
}\r
+\r
+ /// <summary>\r
+ /// Get the GUI equiv to a CLI mixdown\r
+ /// </summary>\r
+ /// <param name="mixdown">The Audio Mixdown</param>\r
+ /// <returns>The GUI representation of the mixdown</returns>\r
+ private static string GetMixDown(string mixdown)\r
+ {\r
+ switch (mixdown.Trim())\r
+ {\r
+ case "mono":\r
+ return "Mono";\r
+ case "stereo":\r
+ return "Stereo";\r
+ case "dpl1":\r
+ return "Dolby Surround";\r
+ case "dpl2":\r
+ return "Dolby Pro Logic II";\r
+ case "6ch":\r
+ return "6 Channel Discrete";\r
+ default:\r
+ return "Automatic";\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Get the GUI equiv to a CLI audio encoder\r
+ /// </summary>\r
+ /// <param name="audioEnc">The Audio Encoder</param>\r
+ /// <returns>The GUI representation of that audio encoder</returns>\r
+ private static string GetAudioEncoder(string audioEnc)\r
+ {\r
+ switch (audioEnc)\r
+ {\r
+ case "faac":\r
+ return "AAC (faac)";\r
+ case "lame":\r
+ return "MP3 (lame)";\r
+ case "vorbis":\r
+ return "Vorbis (vorbis)";\r
+ case "ac3":\r
+ return "AC3 Passthru";\r
+ case "dts":\r
+ return "DTS Passthru";\r
+ default:\r
+ return "AAC (faac)";\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file