From c3c5892ff08f931b0043d8c26e41b57f73f26205 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 14 Jun 2012 19:22:31 +0000 Subject: WinGui: Fix build and further clean out some legacy code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4735 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrake.ApplicationServices/Services/Encode.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'win/CS/HandBrake.ApplicationServices/Services/Encode.cs') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs index 8c04d5a3b..7553456d5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs @@ -21,6 +21,7 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.Parsing; using HandBrake.ApplicationServices.Services.Base; using HandBrake.ApplicationServices.Services.Interfaces; + using HandBrake.ApplicationServices.Utilities; /// /// Class which handles the CLI @@ -120,7 +121,16 @@ namespace HandBrake.ApplicationServices.Services this.VerifyEncodeDestinationPath(currentTask); string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe"); - ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, currentTask.Query) + + // TODO tidy this code up, it's kinda messy. + string query = this.currentTask.Task.IsPreviewEncode + ? QueryGeneratorUtility.GeneratePreviewQuery( + new EncodeTask(this.currentTask.Task), + this.currentTask.Task.PreviewEncodeDuration, + this.currentTask.Task.PreviewEncodeStartAt) + : QueryGeneratorUtility.GenerateQuery(new EncodeTask(this.currentTask.Task)); + + ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, query) { RedirectStandardOutput = true, RedirectStandardError = enableLogging ? true : false, -- cgit v1.2.3