summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-11-19 22:30:26 +0000
committersr55 <[email protected]>2013-11-19 22:30:26 +0000
commit830bb18b173a1c68720eb0df2ed860daea7d4c7e (patch)
tree780e4ad48d4917555121766f5e1f3eb838970042 /win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
parentf83ab26ab8e1d2ce277f0c12f23b5753bf63d763 (diff)
WinGui: Removed the need for the user settings service from IEncode and IScan interfaces and various other places. This makes the API much simpler to use.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5897 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs35
1 files changed, 10 insertions, 25 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
index f1a94a05b..720330c50 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
@@ -34,11 +34,6 @@ namespace HandBrake.ApplicationServices.Services.Base
private static readonly object FileWriterLock = new object();
/// <summary>
- /// The User Setting Service
- /// </summary>
- private readonly IUserSettingService userSettingService;
-
- /// <summary>
/// The Log File Header
/// </summary>
private readonly StringBuilder header;
@@ -58,16 +53,10 @@ namespace HandBrake.ApplicationServices.Services.Base
/// <summary>
/// Initializes a new instance of the <see cref="EncodeBase"/> class.
/// </summary>
- /// <param name="userSettingService">
- /// The user Setting Service.
- /// </param>
- public EncodeBase(IUserSettingService userSettingService)
+ public EncodeBase()
{
- this.userSettingService = userSettingService;
this.logBuffer = new StringBuilder();
- header =
- GeneralUtilities.CreateCliLogHeader();
-
+ header = GeneralUtilities.CreateCliLogHeader();
this.LogIndex = 0;
}
@@ -197,7 +186,10 @@ namespace HandBrake.ApplicationServices.Services.Base
/// <param name="destination">
/// The Destination File Path
/// </param>
- public void ProcessLogs(string destination)
+ /// <param name="configuration">
+ /// The configuration.
+ /// </param>
+ public void ProcessLogs(string destination, HBConfiguration configuration)
{
try
{
@@ -220,17 +212,16 @@ namespace HandBrake.ApplicationServices.Services.Base
File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
// Save a copy of the log file in the same location as the enocde.
- if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SaveLogWithVideo))
+ if (configuration.SaveLogWithVideo)
{
File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
}
// Save a copy of the log file to a user specified location
- if (Directory.Exists(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SaveLogCopyDirectory)) &&
- this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.SaveLogToCopyDirectory))
+ if (Directory.Exists(configuration.SaveLogCopyDirectory) && configuration.SaveLogToCopyDirectory)
{
File.Copy(
- tempLogFile, Path.Combine(this.userSettingService.GetUserSetting<string>(ASUserSettingConstants.SaveLogCopyDirectory), encodeLogFile));
+ tempLogFile, Path.Combine(configuration.SaveLogCopyDirectory, encodeLogFile));
}
}
catch (Exception)
@@ -320,13 +311,7 @@ namespace HandBrake.ApplicationServices.Services.Base
try
{
- string query = QueryGeneratorUtility.GenerateQuery(new EncodeTask(encodeQueueTask.Task),
- userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
- userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
- encodeQueueTask.Configuration.IsDvdNavDisabled,
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva),
- userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode) == VideoScaler.BicubicCl);
+ string query = QueryGeneratorUtility.GenerateQuery(new EncodeTask(encodeQueueTask.Task), encodeQueueTask.Configuration);
this.logBuffer = new StringBuilder();
this.logBuffer.AppendLine(String.Format("CLI Query: {0}", query));
this.logBuffer.AppendLine();