diff options
author | sr55 <[email protected]> | 2007-11-10 22:17:07 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-11-10 22:17:07 +0000 |
commit | 089f31b2c2e04c0dcbad5a4763d34d3c98c3241a (patch) | |
tree | a66c89214eb8d46446b94045af38caa9ff50d3f6 /win/C#/Functions/QueryParser.cs | |
parent | 176b1d21a5696f80d2d064e3a157225b7c46b841 (diff) |
WinGui:
- Selecting a preset now uses the CLI preset data.
- Few small issues fixed in the query parser
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1055 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions/QueryParser.cs')
-rw-r--r-- | win/C#/Functions/QueryParser.cs | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/win/C#/Functions/QueryParser.cs b/win/C#/Functions/QueryParser.cs index a6044b2ab..a4bd1c1e5 100644 --- a/win/C#/Functions/QueryParser.cs +++ b/win/C#/Functions/QueryParser.cs @@ -38,6 +38,19 @@ namespace Handbrake.Functions }
}
+ private string q_format;
+ /// <summary>
+ /// Returns a String
+ /// Full path of the destination.
+ /// </summary>
+ public string Format
+ {
+ get
+ {
+ return this.q_format;
+ }
+ }
+
private int q_dvdTitle;
/// <summary>
/// Returns an Integer
@@ -469,6 +482,8 @@ namespace Handbrake.Functions Match source = r1.Match(input.Replace('"', '\"'));
Match title = Regex.Match(input, @"-t ([0-9]*)");
Match chapters = Regex.Match(input, @"-c ([0-9-]*)");
+ Match format = Regex.Match(input, @"-f ([a-z0-9a-z0-9a-z0-9]*)");
+ //-f mp4
//Destination
Regex r2 = new Regex(@"(-o)(?:\s\"")([a-zA-Z0-9:\\\s\.]+)(?:\"")");
@@ -532,6 +547,12 @@ namespace Handbrake.Functions thisQuery.q_chaptersStart = int.Parse(actTitles[0]);
thisQuery.q_chaptersFinish = int.Parse(actTitles[1]);
}
+
+ if (format.Success != false)
+ {
+
+ thisQuery.q_format = format.ToString().Replace("-f ", "");
+ }
#endregion
//
@@ -562,7 +583,7 @@ namespace Handbrake.Functions videoEncoderConvertion = "H.264 (iPod)";
break;
default:
- videoEncoderConvertion = "H.264";
+ videoEncoderConvertion = "Mpeg 4";
break;
}
thisQuery.q_videoEncoder = videoEncoderConvertion;
@@ -617,6 +638,7 @@ namespace Handbrake.Functions thisQuery.q_detelecine = detelecine.Success;
thisQuery.q_deBlock = deblock.Success;
+ thisQuery.q_deinterlace = "None";
if (deinterlace.Success != false)
{
switch (deinterlace.ToString().Replace("--deinterlace=", ""))
@@ -638,7 +660,8 @@ namespace Handbrake.Functions break;
}
}
-
+
+ thisQuery.q_denoise = "None";
if (denoise.Success != false)
{
switch (denoise.ToString().Replace("--denoise=", ""))
@@ -687,6 +710,7 @@ namespace Handbrake.Functions if (videoQuality.Success != false)
{
qConvert = double.Parse(videoQuality.ToString().Replace("-q ", "")) * 100;
+ qConvert = System.Math.Ceiling(qConvert);
thisQuery.q_videoQuality = int.Parse(qConvert.ToString());
}
thisQuery.q_crf = CRF.Success;
@@ -708,7 +732,12 @@ namespace Handbrake.Functions {
thisQuery.q_audioTrack1 = audioChannel.ToString().Replace("-a ", "");
}
-
+ else
+ {
+ thisQuery.q_audioTrack1 = "Automatic";
+ }
+
+ thisQuery.q_audioTrackMix = "Automatic";
if (audioChannelsMix.Success != false)
{
switch (audioChannelsMix.ToString().Replace("-6 ", "").Replace(" ",""))
@@ -729,7 +758,7 @@ namespace Handbrake.Functions thisQuery.q_audioTrackMix = "6 Channel Discrete";
break;
default:
- thisQuery.q_audioTrackMix = "Automatic2";
+ thisQuery.q_audioTrackMix = "Automatic";
break;
}
@@ -738,6 +767,10 @@ namespace Handbrake.Functions {
thisQuery.q_subtitles = subtitles.ToString().Replace("-s ", "");
}
+ else
+ {
+ thisQuery.q_subtitles = "None";
+ }
#endregion
//
|