summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs27
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs6
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs24
4 files changed, 51 insertions, 9 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index a51a7d43a..13216b608 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -5,11 +5,10 @@
namespace HandBrake.ApplicationServices.Model
{
- using System.Collections.Generic;
using System.Collections.ObjectModel;
+ using System.Linq;
using HandBrake.ApplicationServices.Model.Encoding;
- using HandBrake.ApplicationServices.Parsing;
using HandBrake.Interop.Model;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
@@ -363,5 +362,29 @@ namespace HandBrake.ApplicationServices.Model
/// </summary>
public bool UsesPictureSettings { get; set; }
#endregion
+
+ #region Helpers
+
+ /// <summary>
+ /// Gets a value indicating whether M4v extension is required.
+ /// </summary>
+ public bool RequiresM4v
+ {
+ get
+ {
+ if (this.OutputFormat == OutputFormat.M4V || this.OutputFormat == OutputFormat.Mp4)
+ {
+ bool audio = this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough ||
+ item.Encoder == AudioEncoder.Ac3 || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Passthrough);
+
+ bool subtitles = this.SubtitleTracks.Any(track => track.SubtitleType != SubtitleType.VobSub);
+
+ return audio || subtitles;
+ }
+
+ return false;
+ }
+ }
+ #endregion
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
index 0c8d97c53..b4a23231e 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
@@ -94,7 +94,11 @@ namespace HandBrake.ApplicationServices.Services.Base
{
get
{
- return string.IsNullOrEmpty(this.logBuffer.ToString()) ? this.header + "No log data available..." : this.header + this.logBuffer.ToString();
+ string noLog =
+ "No log data available... Log data will show when you start an encode. \n\nOpen the log file directory to get previous log files.";
+ return string.IsNullOrEmpty(this.logBuffer.ToString())
+ ? this.header + noLog
+ : this.header + this.logBuffer.ToString();
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
index b3470d63e..da9be176b 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
@@ -98,7 +98,8 @@ namespace HandBrake.ApplicationServices.Services
{
get
{
- return string.IsNullOrEmpty(this.logBuffer.ToString()) ? this.header + "No log data available..." : this.header + this.logBuffer.ToString();
+ string noLog = "No log data available... Log data will show where after you scan a source. \n\nOpen the log file directory to get previous log files.";
+ return string.IsNullOrEmpty(this.logBuffer.ToString()) ? this.header + noLog : this.header + this.logBuffer.ToString();
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index 5cf5d7712..7ba4d2f7d 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -16,6 +16,7 @@ namespace HandBrake.ApplicationServices.Utilities
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding.x264;
/// <summary>
/// Generate a CLI Query for HandBrakeCLI
@@ -767,11 +768,24 @@ namespace HandBrake.ApplicationServices.Utilities
{
if (task.VideoEncoder == VideoEncoder.X264)
{
- return string.Format(
- " --x264-preset={0} --x264-tune={1} --x264-profile={2}",
- task.x264Preset.ToString().ToLower().Replace(" ", string.Empty),
- task.X264Tune.ToString().ToLower().Replace(" ", string.Empty),
- task.x264Profile.ToString().ToLower().Replace(" ", string.Empty));
+ string query = string.Empty;
+
+ if (task.x264Preset != x264Preset.None)
+ {
+ query += string.Format("--x264-preset={0} ", task.x264Preset.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ if (task.x264Profile != x264Profile.None)
+ {
+ query += string.Format("--x264-profile={0} ", task.x264Profile.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ if (task.X264Tune != x264Tune.None)
+ {
+ query += string.Format("--x264-tune={0} ", task.X264Tune.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ return query;
}
return string.IsNullOrEmpty(task.AdvancedEncoderOptions) ? string.Empty : string.Format(" -x {0}", task.AdvancedEncoderOptions);