summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-06-14 19:22:31 +0000
committersr55 <[email protected]>2012-06-14 19:22:31 +0000
commitc3c5892ff08f931b0043d8c26e41b57f73f26205 (patch)
tree81e0ce86b095aa03ca0fd3cf4053e58b2ddccaf8 /win/CS/HandBrake.ApplicationServices
parenta53a05ae0921b38cc1c9d3dd3dd5bab09a6c7f5f (diff)
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
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs16
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs31
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode.cs12
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs3
5 files changed, 32 insertions, 35 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index 6ed3bf2e1..cdd436b03 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -460,6 +460,7 @@ namespace HandBrake.ApplicationServices.Model
/// Gets or sets Duration.
/// </summary>
public int? PreviewDuration { get; set; }
+
#endregion
#region Helpers
@@ -484,6 +485,21 @@ namespace HandBrake.ApplicationServices.Model
return false;
}
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsPreviewEncode.
+ /// </summary>
+ public bool IsPreviewEncode { get; set; }
+
+ /// <summary>
+ /// Gets or sets PreviewEncodeDuration.
+ /// </summary>
+ public int PreviewEncodeDuration { get; set; }
+
+ /// <summary>
+ /// Gets or sets PreviewEncodeStartAt.
+ /// </summary>
+ public string PreviewEncodeStartAt { get; set; }
#endregion
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
index a62115109..0e06ca5c6 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
@@ -25,32 +25,6 @@ namespace HandBrake.ApplicationServices.Model
#endregion
- #region Constructors and Destructors
-
- /// <summary>
- /// Initializes a new instance of the <see cref="QueueTask"/> class.
- /// </summary>
- public QueueTask()
- {
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="QueueTask"/> class.
- /// </summary>
- /// <param name="query">
- /// The query.
- /// </param>
- public QueueTask(string query)
- {
- this.Query = query;
- if (this.Task == null)
- {
- this.Task = new EncodeTask();
- }
- }
-
- #endregion
-
#region Properties
/// <summary>
@@ -59,11 +33,6 @@ namespace HandBrake.ApplicationServices.Model
public bool CustomQuery { get; set; }
/// <summary>
- /// Gets or sets the query string.
- /// </summary>
- public string Query { get; set; }
-
- /// <summary>
/// Gets or sets Status.
/// </summary>
public QueueItemStatus Status
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
index 537a97d71..e04c4e830 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
@@ -257,8 +257,9 @@ namespace HandBrake.ApplicationServices.Services.Base
try
{
+ string query = QueryGeneratorUtility.GenerateQuery(new EncodeTask(encodeQueueTask.Task));
this.logBuffer = new StringBuilder();
- this.logBuffer.AppendLine(String.Format("CLI Query: {0}", encodeQueueTask.Query));
+ this.logBuffer.AppendLine(String.Format("CLI Query: {0}", query));
this.logBuffer.AppendLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));
this.logBuffer.AppendLine();
@@ -275,7 +276,7 @@ namespace HandBrake.ApplicationServices.Services.Base
this.fileWriter = new StreamWriter(logFile) { AutoFlush = true };
this.fileWriter.WriteLine(GeneralUtilities.CreateCliLogHeader());
- this.fileWriter.WriteLine(String.Format("CLI Query: {0}", encodeQueueTask.Query));
+ this.fileWriter.WriteLine(String.Format("CLI Query: {0}", query));
this.fileWriter.WriteLine(String.Format("User Query: {0}", encodeQueueTask.CustomQuery));
this.fileWriter.WriteLine();
}
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;
/// <summary>
/// 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,
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs
index 0d3a40e7f..8464ffed2 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs
@@ -23,6 +23,7 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
using EventArgs = System.EventArgs;
@@ -392,7 +393,7 @@ namespace HandBrake.ApplicationServices.Services
string queries = string.Empty;
foreach (QueueTask queueItem in this.queue)
{
- string qItem = queueItem.Query;
+ string qItem = QueryGeneratorUtility.GenerateQuery(new EncodeTask(queueItem.Task));
string fullQuery = '"' + Application.StartupPath + "\\HandBrakeCLI.exe" + '"' + qItem;
if (queries == string.Empty)