diff options
Diffstat (limited to 'win/CS')
24 files changed, 486 insertions, 423 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs index 741723329..5c49c5073 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs @@ -64,14 +64,16 @@ namespace HandBrake.ApplicationServices.Interop.Factories DestSettings = new DestSettings
{
AnamorphicMode = (int)job.Anamorphic,
- Geometry = {
- Width = job.Width ?? 0, Height = job.Height ?? 0,
- PAR = new PAR
- {
- Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
- Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
- }
- },
+ Geometry =
+ {
+ Width = job.Width ?? 0,
+ Height = job.Height ?? 0,
+ PAR = new PAR
+ {
+ Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
+ Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
+ }
+ },
Keep = settingMode,
Crop = new List<int> { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
Modulus = job.Modulus ?? 16,
@@ -98,7 +100,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories /// </summary>
/// <param name="settings">The preview settings.</param>
/// <param name="title">Information on the title to consider.</param>
- /// <returns></returns>
+ /// <returns>Geometry Information</returns>
public static Geometry CreateGeometry(PreviewSettings settings, SourceVideoInfo title)
{
int settingMode = settings.KeepDisplayAspect ? 0x04 : 0;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs index aad5df21c..ccbaee4c1 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs @@ -20,18 +20,18 @@ namespace HandBrake.ApplicationServices.Interop using HandBrake.ApplicationServices.Interop.Json.Shared;
using HandBrake.ApplicationServices.Services.Logging;
using HandBrake.ApplicationServices.Services.Logging.Model;
- - using Newtonsoft.Json; - - /// <summary> - /// HandBrake Interop Utilities - /// </summary> - public static class HandBrakeUtils - { - /// <summary> - /// The callback for log messages from HandBrake. - /// </summary> - private static LoggingCallback loggingCallback; +
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// HandBrake Interop Utilities
+ /// </summary>
+ public static class HandBrakeUtils
+ {
+ /// <summary>
+ /// The callback for log messages from HandBrake.
+ /// </summary>
+ private static LoggingCallback loggingCallback;
/// <summary>
/// The callback for error messages from HandBrake.
@@ -223,12 +223,12 @@ namespace HandBrake.ApplicationServices.Interop public static bool IsH264LevelValid(string level, int width, int height, int fpsNumerator, int fpsDenominator, bool interlaced, bool fakeInterlaced)
{
return HBFunctions.hb_check_h264_level(
- level,
- width,
- height,
- fpsNumerator,
- fpsDenominator,
- interlaced ? 1 : 0,
+ level,
+ width,
+ height,
+ fpsNumerator,
+ fpsDenominator,
+ interlaced ? 1 : 0,
fakeInterlaced ? 1 : 0) == 0;
}
@@ -260,12 +260,12 @@ namespace HandBrake.ApplicationServices.Interop /// The full x264 options string from the given inputs.
/// </returns>
public static string CreateX264OptionsString(
- string preset,
- IList<string> tunes,
- string extraOptions,
- string profile,
- string level,
- int width,
+ string preset,
+ IList<string> tunes,
+ string extraOptions,
+ string profile,
+ string level,
+ int width,
int height)
{
if (width <= 0)
@@ -279,35 +279,35 @@ namespace HandBrake.ApplicationServices.Interop }
IntPtr ptr = HBFunctions.hb_x264_param_unparse(
- preset,
- string.Join(",", tunes),
- extraOptions,
- profile,
- level,
- width,
+ preset,
+ string.Join(",", tunes),
+ extraOptions,
+ profile,
+ level,
+ width,
height);
string x264Settings = Marshal.PtrToStringAnsi(ptr);
- return x264Settings; - } - - /// <summary> - /// Gets the final size and PAR of the video, given anamorphic inputs. - /// </summary> - /// <param name="anamorphicGeometry">Anamorphic inputs.</param> - /// <returns>The final size and PAR of the video.</returns> - public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry) - { - string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug)); - IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode)); - string result = Marshal.PtrToStringAnsi(json); - return JsonConvert.DeserializeObject<Geometry>(result); - } - - /// <summary> - /// Sends the message logged event to any registered listeners. + return x264Settings;
+ }
+
+ /// <summary>
+ /// Gets the final size and PAR of the video, given anamorphic inputs.
+ /// </summary>
+ /// <param name="anamorphicGeometry">Anamorphic inputs.</param>
+ /// <returns>The final size and PAR of the video.</returns>
+ public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry)
+ {
+ string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
+ LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug));
+ IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode));
+ string result = Marshal.PtrToStringAnsi(json);
+ return JsonConvert.DeserializeObject<Geometry>(result);
+ }
+
+ /// <summary>
+ /// Sends the message logged event to any registered listeners.
/// </summary>
/// <param name="message">
/// The message to send.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs index 3a8aedec7..af4ece97e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs @@ -1,7 +1,10 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SubtitleTrack.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleTrack.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Represents a subtitle track to encode.
+// </summary>
// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Interop.Json.Encode diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs index 091f9a4f8..b26baea0e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs @@ -1,7 +1,10 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceAudioTrack.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceAudioTrack.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// An audio track from the source video.
+// </summary>
// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Interop.Json.Scan diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs index fce479ff1..fb0d84955 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs @@ -1,7 +1,10 @@ -// -------------------------------------------------------------------------------------------------------------------- -// <copyright file="SourceChapter.cs" company="HandBrake Project (http://handbrake.fr)"> -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// </copyright> +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SourceChapter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The a chapter from a video source.
+// </summary>
// -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Interop.Json.Scan diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs index a748fc99e..62ff64200 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs @@ -15,12 +15,12 @@ namespace HandBrake.ApplicationServices.Interop.Model public class BitrateLimits
{
/// <summary>
- /// The inclusive lower limit for the bitrate.
+ /// Gets or sets the inclusive lower limit for the bitrate.
/// </summary>
public int Low { get; set; }
/// <summary>
- /// The inclusive upper limit for the bitrate.
+ /// Gets or sets the inclusive upper limit for the bitrate.
/// </summary>
public int High { get; set; }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs index af1a166ce..bcc7f2714 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs @@ -6,52 +6,85 @@ // The preview settings.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
- -namespace HandBrake.ApplicationServices.Interop.Model.Preview -{ - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrake.ApplicationServices.Services.Encode.Model; - - /// <summary> - /// The preview settings. - /// </summary> - public class PreviewSettings - { - /// <summary> - /// Initializes a new instance of the <see cref="PreviewSettings"/> class. - /// </summary> - public PreviewSettings() - { - } - - /// <summary> - /// Initializes a new instance of the <see cref="PreviewSettings"/> class. - /// </summary> - /// <param name="task">The task.</param> - public PreviewSettings(EncodeTask task) - { - } - - public Cropping Cropping { get; set; } - - public int MaxWidth { get; set; } - - public int MaxHeight { get; set; } - - public bool KeepDisplayAspect { get; set; } - - public int TitleNumber { get; set; } - - public Anamorphic Anamorphic { get; set; } - - public int? Modulus { get; set; } - - public int Width { get; set; } - - public int Height { get; set; } - - public int PixelAspectX { get; set; } - - public int PixelAspectY { get; set; } - } -} +
+namespace HandBrake.ApplicationServices.Interop.Model.Preview
+{
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Encode.Model;
+
+ /// <summary>
+ /// The preview settings.
+ /// </summary>
+ public class PreviewSettings
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
+ /// </summary>
+ public PreviewSettings()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
+ /// </summary>
+ /// <param name="task">The task.</param>
+ public PreviewSettings(EncodeTask task)
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the cropping.
+ /// </summary>
+ public Cropping Cropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max width.
+ /// </summary>
+ public int MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max height.
+ /// </summary>
+ public int MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether keep display aspect.
+ /// </summary>
+ public bool KeepDisplayAspect { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title number.
+ /// </summary>
+ public int TitleNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the anamorphic.
+ /// </summary>
+ public Anamorphic Anamorphic { get; set; }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public int? Modulus { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect x.
+ /// </summary>
+ public int PixelAspectX { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect y.
+ /// </summary>
+ public int PixelAspectY { get; set; }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs index 54b80b28c..8554c843b 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs @@ -14,24 +14,24 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories using System.Linq;
using System.Runtime.InteropServices;
- using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Json; - using HandBrake.ApplicationServices.Interop.Json.Anamorphic; - using HandBrake.ApplicationServices.Interop.Json.Encode; - using HandBrake.ApplicationServices.Interop.Json.Shared; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.ApplicationServices.Interop;
+ using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Helpers;
+ using HandBrake.ApplicationServices.Interop.Json;
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Json.Encode;
+ using HandBrake.ApplicationServices.Interop.Json.Shared;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Services.Encode.Model.Models; - using HandBrake.ApplicationServices.Utilities; - - using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack; - using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles; - - /// <summary> - /// This factory takes the internal EncodeJob object and turns it into a set of JSON models + using HandBrake.ApplicationServices.Services.Encode.Model.Models;
+ using HandBrake.ApplicationServices.Utilities;
+
+ using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack;
+ using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles;
+
+ /// <summary>
+ /// This factory takes the internal EncodeJob object and turns it into a set of JSON models
/// that can be deserialized by libhb.
/// </summary>
internal class EncodeFactory
@@ -51,23 +51,23 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// <param name="configuration">
/// The configuration.
/// </param>
- /// <returns> - /// The <see cref="JsonEncodeObject"/>. - /// </returns> - internal static JsonEncodeObject Create(EncodeTask job, HBConfiguration configuration) - { - JsonEncodeObject encode = new JsonEncodeObject - { - SequenceID = 0, - Audio = CreateAudio(job), - Destination = CreateDestination(job), - Filters = CreateFilters(job), - PAR = CreatePAR(job), - Metadata = CreateMetadata(job), - Source = CreateSource(job, configuration), - Subtitle = CreateSubtitle(job), - Video = CreateVideo(job, configuration) - }; + /// <returns>
+ /// The <see cref="JsonEncodeObject"/>.
+ /// </returns>
+ internal static JsonEncodeObject Create(EncodeTask job, HBConfiguration configuration)
+ {
+ JsonEncodeObject encode = new JsonEncodeObject
+ {
+ SequenceID = 0,
+ Audio = CreateAudio(job),
+ Destination = CreateDestination(job),
+ Filters = CreateFilters(job),
+ PAR = CreatePAR(job),
+ Metadata = CreateMetadata(job),
+ Source = CreateSource(job, configuration),
+ Subtitle = CreateSubtitle(job),
+ Video = CreateVideo(job, configuration)
+ };
return encode;
}
@@ -88,36 +88,36 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories {
Range range = new Range();
switch (job.PointToPointMode)
- { - case PointToPointMode.Chapters: - range.Type = "chapter"; - range.Start = job.StartPoint; - range.End = job.EndPoint; - break; - case PointToPointMode.Seconds: - range.Type = "time"; - range.Start = job.StartPoint * 90000; - range.End = (job.EndPoint - job.StartPoint) * 90000; - break; - case PointToPointMode.Frames: - range.Type = "frame"; - range.Start = job.StartPoint; - range.End = job.EndPoint; - break; - case PointToPointMode.Preview: - range.Type = "preview"; - range.Start = job.PreviewEncodeStartAt; - range.SeekPoints = configuration.PreviewScanCount; - range.End = job.PreviewEncodeDuration * 90000; - break; - } - - Source source = new Source - { - Title = job.Title, - Range = range, - Angle = job.Angle, - Path = job.Source, + {
+ case PointToPointMode.Chapters:
+ range.Type = "chapter";
+ range.Start = job.StartPoint;
+ range.End = job.EndPoint;
+ break;
+ case PointToPointMode.Seconds:
+ range.Type = "time";
+ range.Start = job.StartPoint * 90000;
+ range.End = (job.EndPoint - job.StartPoint) * 90000;
+ break;
+ case PointToPointMode.Frames:
+ range.Type = "frame";
+ range.Start = job.StartPoint;
+ range.End = job.EndPoint;
+ break;
+ case PointToPointMode.Preview:
+ range.Type = "preview";
+ range.Start = job.PreviewEncodeStartAt;
+ range.SeekPoints = configuration.PreviewScanCount;
+ range.End = job.PreviewEncodeDuration * 90000;
+ break;
+ }
+
+ Source source = new Source
+ {
+ Title = job.Title,
+ Range = range,
+ Angle = job.Angle,
+ Path = job.Source,
};
return source;
}
@@ -132,28 +132,28 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// The <see cref="Destination"/>.
/// </returns>
private static Destination CreateDestination(EncodeTask job)
- { - Destination destination = new Destination - { - File = job.Destination, - Mp4Options = new Mp4Options - { - IpodAtom = job.IPod5GSupport, - Mp4Optimize = job.OptimizeMP4 - }, - ChapterMarkers = job.IncludeChapterMarkers, - Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up. - ChapterList = new List<Chapter>() - }; - - if (job.IncludeChapterMarkers) - { - foreach (ChapterMarker item in job.ChapterNames) - { - Chapter chapter = new Chapter { Name = item.ChapterName }; - destination.ChapterList.Add(chapter); - } - } + {
+ Destination destination = new Destination
+ {
+ File = job.Destination,
+ Mp4Options = new Mp4Options
+ {
+ IpodAtom = job.IPod5GSupport,
+ Mp4Optimize = job.OptimizeMP4
+ },
+ ChapterMarkers = job.IncludeChapterMarkers,
+ Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up.
+ ChapterList = new List<Chapter>()
+ };
+
+ if (job.IncludeChapterMarkers)
+ {
+ foreach (ChapterMarker item in job.ChapterNames)
+ {
+ Chapter chapter = new Chapter { Name = item.ChapterName };
+ destination.ChapterList.Add(chapter);
+ }
+ }
return destination;
}
@@ -178,28 +178,28 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// <param name="job">
/// The job.
/// </param>
- /// <returns> - /// The <see cref="HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles"/>. - /// </returns> - private static Subtitle CreateSubtitle(EncodeTask job) - { - Subtitles subtitle = new Subtitles - { - Search = - new SubtitleSearch - { - Enable = false, - Default = false, - Burn = false, - Forced = false - }, - SubtitleList = new List<HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack>() - }; - - foreach (HandBrake.ApplicationServices.Services.Encode.Model.Models.SubtitleTrack item in job.SubtitleTracks) - { - if (!item.IsSrtSubtitle) - { + /// <returns>
+ /// The <see cref="HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles"/>.
+ /// </returns>
+ private static Subtitle CreateSubtitle(EncodeTask job)
+ {
+ Subtitles subtitle = new Subtitles
+ {
+ Search =
+ new SubtitleSearch
+ {
+ Enable = false,
+ Default = false,
+ Burn = false,
+ Forced = false
+ },
+ SubtitleList = new List<HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack>()
+ };
+
+ foreach (HandBrake.ApplicationServices.Services.Encode.Model.Models.SubtitleTrack item in job.SubtitleTracks)
+ {
+ if (!item.IsSrtSubtitle)
+ {
// Handle Foreign Audio Search
if (item.SourceTrack.TrackNumber == 0)
{
@@ -207,27 +207,27 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories subtitle.Search.Burn = item.Burned;
subtitle.Search.Default = item.Default;
subtitle.Search.Forced = item.Forced;
- } - else - { - HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack - { - Burn = item.Burned, - Default = item.Default, - Forced = item.Forced, - ID = item.SourceTrack.TrackNumber, - Track = (item.SourceTrack.TrackNumber - 1) - }; - - subtitle.SubtitleList.Add(track); - } - } - else - { - HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack - { - Track = -1, // Indicates SRT - Default = item.Default, + }
+ else
+ {
+ HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
+ {
+ Burn = item.Burned,
+ Default = item.Default,
+ Forced = item.Forced,
+ ID = item.SourceTrack.TrackNumber,
+ Track = (item.SourceTrack.TrackNumber - 1)
+ };
+
+ subtitle.SubtitleList.Add(track);
+ }
+ }
+ else
+ {
+ HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
+ {
+ Track = -1, // Indicates SRT
+ Default = item.Default,
Offset = item.SrtOffset,
Burn = item.Burned,
SRT =
@@ -237,13 +237,13 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories Codeset = item.SrtCharCode,
Language = item.SrtLang
}
- }; - - subtitle.SubtitleList.Add(track); - } - } - - return subtitle; + };
+
+ subtitle.SubtitleList.Add(track);
+ }
+ }
+
+ return subtitle;
}
/// <summary>
@@ -315,64 +315,64 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// The <see cref="Audio"/>.
/// </returns>
private static Audio CreateAudio(EncodeTask job)
- { - Audio audio = new Audio(); - - List<uint> copyMaskList = new List<uint>(); - if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(NativeConstants.HB_ACODEC_AAC_PASS); - if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_AC3_PASS); - if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_HD_PASS); + {
+ Audio audio = new Audio();
+
+ List<uint> copyMaskList = new List<uint>();
+ if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(NativeConstants.HB_ACODEC_AAC_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_AC3_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_HD_PASS);
if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_PASS);
if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_EAC3_PASS);
- if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(NativeConstants.HB_ACODEC_FLAC_PASS); - if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_MP3_PASS); - if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_TRUEHD_PASS); - audio.CopyMask = copyMaskList.ToArray(); - - HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback)); - audio.FallbackEncoder = audioEncoder.Id; - - audio.AudioList = new List<Interop.Json.Encode.AudioTrack>(); - foreach (AudioTrack item in job.AudioTracks) - { - HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(ApplicationServices.Utilities.Converters.GetCliAudioEncoder(item.Encoder)); - Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder); - - HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown)); - Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown)); - - HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack audioTrack = new HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack - { - Track = (item.Track.HasValue ? item.Track.Value : 0) - 1, - DRC = item.DRC, - Encoder = encoder.Id, - Gain = item.Gain, - Mixdown = mixdown.Id, - NormalizeMixLevel = false, - Samplerate = GetSampleRateRaw(item.SampleRate), - Name = item.TrackName, + if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(NativeConstants.HB_ACODEC_FLAC_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_MP3_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_TRUEHD_PASS);
+ audio.CopyMask = copyMaskList.ToArray();
+
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
+ audio.FallbackEncoder = audioEncoder.Id;
+
+ audio.AudioList = new List<Interop.Json.Encode.AudioTrack>();
+ foreach (AudioTrack item in job.AudioTracks)
+ {
+ HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(ApplicationServices.Utilities.Converters.GetCliAudioEncoder(item.Encoder));
+ Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
+
+ HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
+ Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
+
+ HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack audioTrack = new HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack
+ {
+ Track = (item.Track.HasValue ? item.Track.Value : 0) - 1,
+ DRC = item.DRC,
+ Encoder = encoder.Id,
+ Gain = item.Gain,
+ Mixdown = mixdown.Id,
+ NormalizeMixLevel = false,
+ Samplerate = GetSampleRateRaw(item.SampleRate),
+ Name = item.TrackName,
};
if (!item.IsPassthru)
{
// TODO Impiment Quality and Compression. We only support bitrate right now.
- //if (item.EncodeRateType == AudioEncodeRateType.Quality)
- //{
+ // if (item.EncodeRateType == AudioEncodeRateType.Quality)
+ // {
// audioTrack.Quality = item.Quality;
- //}
+ // }
- //if (item.EncodeRateType == AudioEncodeRateType.Compression)
- //{
+ // if (item.EncodeRateType == AudioEncodeRateType.Compression)
+ // {
// audioTrack.CompressionLevel = item.Compression;
- //} - - //if (item.EncodeRateType == AudioEncodeRateType.Bitrate) - // { - audioTrack.Bitrate = item.Bitrate; - // } - } - - audio.AudioList.Add(audioTrack); + // }
+
+ // if (item.EncodeRateType == AudioEncodeRateType.Bitrate)
+ // {
+ audioTrack.Bitrate = item.Bitrate;
+ // }
+ }
+
+ audio.AudioList.Add(audioTrack);
}
return audio;
@@ -406,17 +406,17 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// <param name="job">
/// The job.
/// </param>
- /// <returns> - /// The <see cref="Filters"/>. - /// </returns> - private static Filters CreateFilters(EncodeTask job) - { - Filters filter = new Filters - { - FilterList = new List<Filter>(), - Grayscale = job.Grayscale - }; - + /// <returns>
+ /// The <see cref="Filters"/>.
+ /// </returns>
+ private static Filters CreateFilters(EncodeTask job)
+ {
+ Filters filter = new Filters
+ {
+ FilterList = new List<Filter>(),
+ Grayscale = job.Grayscale
+ };
+
// Detelecine
if (job.Detelecine != Detelecine.Off)
{
@@ -521,21 +521,21 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories filter.FilterList.Add(filterItem);
}
- // CropScale Filter - Filter cropScale = new Filter - { - ID = (int)hb_filter_ids.HB_FILTER_CROP_SCALE, - Settings = - string.Format( - "{0}:{1}:{2}:{3}:{4}:{5}", - job.Width, - job.Height, - job.Cropping.Top, - job.Cropping.Bottom, - job.Cropping.Left, - job.Cropping.Right) - }; - filter.FilterList.Add(cropScale); + // CropScale Filter
+ Filter cropScale = new Filter
+ {
+ ID = (int)hb_filter_ids.HB_FILTER_CROP_SCALE,
+ Settings =
+ string.Format(
+ "{0}:{1}:{2}:{3}:{4}:{5}",
+ job.Width,
+ job.Height,
+ job.Cropping.Top,
+ job.Cropping.Bottom,
+ job.Cropping.Left,
+ job.Cropping.Right)
+ };
+ filter.FilterList.Add(cropScale);
// Rotate
/* TODO NOT SUPPORTED YET. */
@@ -547,17 +547,17 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories /// The create meta data.
/// </summary>
/// <param name="job">
- /// The job. - /// </param> - /// <returns> - /// The <see cref="Metadata"/>. - /// </returns> - private static Metadata CreateMetadata(EncodeTask job) - { - Metadata metaData = new Metadata(); - - /* TODO NOT SUPPORTED YET. */ - return metaData; + /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Metadata"/>.
+ /// </returns>
+ private static Metadata CreateMetadata(EncodeTask job)
+ {
+ Metadata metaData = new Metadata();
+
+ /* TODO NOT SUPPORTED YET. */
+ return metaData;
}
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index a0718262d..6ad5875cf 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -164,7 +164,6 @@ namespace HandBrake.ApplicationServices.Services.Encode }
}
-
#region HandBrakeInstance Event Handlers.
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index 5eab75520..b67513826 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -102,13 +102,13 @@ namespace HandBrake.ApplicationServices.Services.Scan #region Events
- /// <summary> - /// Scan has Started - /// </summary> - public event EventHandler ScanStarted; - - /// <summary> - /// Scan has completed + /// <summary>
+ /// Scan has Started
+ /// </summary>
+ public event EventHandler ScanStarted;
+
+ /// <summary>
+ /// Scan has completed
/// </summary>
public event ScanCompletedStatus ScanCompleted;
@@ -318,14 +318,14 @@ namespace HandBrake.ApplicationServices.Services.Scan HandBrakeUtils.SetDvdNav(!configuraiton.IsDvdNavDisabled);
- this.ServiceLogMessage("Starting Scan ..."); - this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0); - - if (this.ScanStarted != null) - this.ScanStarted(this, System.EventArgs.Empty); - } - catch (Exception exc) - { + this.ServiceLogMessage("Starting Scan ...");
+ this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0);
+
+ if (this.ScanStarted != null)
+ this.ScanStarted(this, System.EventArgs.Empty);
+ }
+ catch (Exception exc)
+ {
this.ServiceLogMessage("Scan Failed ..." + Environment.NewLine + exc);
this.Stop();
@@ -488,28 +488,28 @@ namespace HandBrake.ApplicationServices.Services.Scan Playlist = title.Type == 1 ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null,
FramerateNumerator = title.FrameRate.Num,
FramerateDenominator = title.FrameRate.Den
- }; - - int currentTrack = 1; - foreach (SourceChapter chapter in title.ChapterList) - { - string chapterName = !string.IsNullOrEmpty(chapter.Name) ? chapter.Name : string.Empty; - converted.Chapters.Add(new Chapter(currentTrack, chapterName, new TimeSpan(chapter.Duration.Hours, chapter.Duration.Minutes, chapter.Duration.Seconds))); + };
+
+ int currentTrack = 1;
+ foreach (SourceChapter chapter in title.ChapterList)
+ {
+ string chapterName = !string.IsNullOrEmpty(chapter.Name) ? chapter.Name : string.Empty;
+ converted.Chapters.Add(new Chapter(currentTrack, chapterName, new TimeSpan(chapter.Duration.Hours, chapter.Duration.Minutes, chapter.Duration.Seconds)));
currentTrack++;
- } - - int currentAudioTrack = 1; - foreach (SourceAudioTrack track in title.AudioList) - { - converted.AudioTracks.Add(new Audio(currentAudioTrack, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.BitRate)); - currentAudioTrack++; - } - - int currentSubtitleTrack = 1; - foreach (SourceSubtitleTrack track in title.SubtitleList) - { - SubtitleType convertedType = new SubtitleType(); - + }
+
+ int currentAudioTrack = 1;
+ foreach (SourceAudioTrack track in title.AudioList)
+ {
+ converted.AudioTracks.Add(new Audio(currentAudioTrack, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.BitRate));
+ currentAudioTrack++;
+ }
+
+ int currentSubtitleTrack = 1;
+ foreach (SourceSubtitleTrack track in title.SubtitleList)
+ {
+ SubtitleType convertedType = new SubtitleType();
+
switch (track.Source)
{
case 0:
@@ -538,7 +538,6 @@ namespace HandBrake.ApplicationServices.Services.Scan break;
}
-
bool canBurn = HBFunctions.hb_subtitle_can_burn(track.Source) > 0;
bool canSetForcedOnly = HBFunctions.hb_subtitle_can_force(track.Source) > 0;
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs index d681106e0..3e61b35d8 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs @@ -154,8 +154,6 @@ namespace HandBrake.ApplicationServices.Utilities }
}
-
-
/// <summary>
/// Get the GUI equiv to a GUI audio encoder string
/// </summary>
@@ -232,7 +230,6 @@ namespace HandBrake.ApplicationServices.Utilities #region Video
-
/// <summary>
/// Get the Video Encoder for a given string
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Execute.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Execute.cs index 7f5889891..c98140977 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/Execute.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/Execute.cs @@ -27,7 +27,7 @@ namespace HandBrake.ApplicationServices.Utilities private static bool? inDesignMode;
/// <summary>
- /// Indicates whether or not the framework is in design-time mode.
+ /// Gets a value indicating whether or not the framework is in design-time mode.
/// </summary>
public static bool InDesignMode
{
@@ -72,6 +72,12 @@ namespace HandBrake.ApplicationServices.Utilities Execute.dispatcher = (Dispatcher)null;
}
+ /// <summary>
+ /// The validate dispatcher.
+ /// </summary>
+ /// <exception cref="InvalidOperationException">
+ /// Not initialized with dispatcher.
+ /// </exception>
private static void ValidateDispatcher()
{
if (Execute.dispatcher == null)
@@ -91,7 +97,12 @@ namespace HandBrake.ApplicationServices.Utilities /// <summary>
/// Executes the action on the UI thread asynchronously.
/// </summary>
- /// <param name="action">The action to execute.</param>
+ /// <param name="action">
+ /// The action to execute.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Task"/>.
+ /// </returns>
public static Task OnUIThreadAsync(this System.Action action)
{
Execute.ValidateDispatcher();
@@ -112,6 +123,12 @@ namespace HandBrake.ApplicationServices.Utilities return (Task)taskSource.Task;
}
+ /// <summary>
+ /// The check access.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
private static bool CheckAccess()
{
if (Execute.dispatcher != null)
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/ExtensionMethods.cs b/win/CS/HandBrake.ApplicationServices/Utilities/ExtensionMethods.cs index 53db9e23f..9966002c7 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/ExtensionMethods.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/ExtensionMethods.cs @@ -1,20 +1,31 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ExtensionMethods.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The extension methods.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Utilities
{
using System.Linq.Expressions;
using System.Reflection;
+ /// <summary>
+ /// The extension methods.
+ /// </summary>
public static class ExtensionMethods
{
/// <summary>
/// Converts an expression into a <see cref="MemberInfo"/>.
/// </summary>
- /// <param name="expression">The expression to convert.</param>
- /// <returns>The member info.</returns>
+ /// <param name="expression">
+ /// The expression to convert.
+ /// </param>
+ /// <returns>
+ /// The member info.
+ /// </returns>
public static MemberInfo GetMemberInfo(this Expression expression)
{
var lambda = (LambdaExpression)expression;
@@ -30,6 +41,5 @@ namespace HandBrake.ApplicationServices.Utilities return memberExpression.Member;
}
-
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs index 2e8e3f05f..f92332c61 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs @@ -29,11 +29,6 @@ namespace HandBrake.ApplicationServices.Utilities /// </summary>
private static readonly string LogDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- /// <summary>
- /// The is lib hb present.
- /// </summary>
- private static bool? isLibHbPresent;
-
#endregion
#region Properties
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PropertyChangedBase.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PropertyChangedBase.cs index b5de5dd22..071243621 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/PropertyChangedBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/PropertyChangedBase.cs @@ -27,7 +27,7 @@ namespace HandBrake.ApplicationServices.Utilities private bool isNotifying;
/// <summary>
- /// Enables/Disables property change notification.
+ /// Gets or sets a value indicating whether the Enables/Disables property change notification.
/// </summary>
[Browsable(false)]
public bool IsNotifying
@@ -48,6 +48,7 @@ namespace HandBrake.ApplicationServices.Utilities public event PropertyChangedEventHandler PropertyChanged = (param0, param1) => { };
/// <summary>
+ /// Initializes a new instance of the <see cref="PropertyChangedBase"/> class.
/// Creates an instance of <see cref="T:HandBrake.ApplicationServices.Utilities.PropertyChangedBase"/>.
/// </summary>
public PropertyChangedBase()
diff --git a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs index 404e2981b..90afe8e33 100644 --- a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs @@ -104,7 +104,6 @@ namespace HandBrakeWPF.Controls /// </param>
private static void OnCancelActionSet(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
-
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs index b14695922..12a994914 100644 --- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs +++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs @@ -186,7 +186,7 @@ namespace HandBrakeWPF.Helpers maxHeight = job.MaxHeight,
mode = (int)(hb_anamorphic_mode_t)job.AnamorphicMode,
modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,
- geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}
+ geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}
};
hb_geometry_s sourceGeometry = new hb_geometry_s
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs index 804f77b19..eb38c62ad 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs @@ -148,7 +148,6 @@ namespace HandBrakeWPF.Services.Presets.Factories AddEncodeElement(xmlWriter, "Mp4iPodCompatible", "integer", parsed.IPod5GSupport ? "1" : "0");
AddEncodeElement(xmlWriter, "PictureAutoCrop", "integer", "1");
-
// Filters
AddEncodeElement(xmlWriter, "PictureDeblock", "integer", parsed.Deblock.ToString());
@@ -158,7 +157,6 @@ namespace HandBrakeWPF.Services.Presets.Factories AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", parsed.Deinterlace == Deinterlace.Custom ? parsed.CustomDeinterlace : string.Empty);
AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", ((int)parsed.Deinterlace).ToString());
-
AddEncodeElement(xmlWriter, "PictureDenoiseFilter", "string", parsed.Denoise.ToString().ToLower());
AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", parsed.DenoisePreset == DenoisePreset.Custom ? parsed.CustomDenoise : string.Empty);
AddEncodeElement(xmlWriter, "PictureDenoisePreset", "string", parsed.DenoisePreset.ToString().ToLower());
@@ -212,7 +210,6 @@ namespace HandBrakeWPF.Services.Presets.Factories AddEncodeElement(xmlWriter, "VideoOptionExtra", "string", parsed.ExtraAdvancedArguments);
AddEncodeElement(xmlWriter, "x264UseAdvancedOptions", "integer", parsed.ShowAdvancedTab ? "1" : "0");
-
int videoQualityType = 0;
if (parsed.VideoBitrate != null) videoQualityType = 1;
else if (parsed.Quality != null) videoQualityType = 2;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs index a8b0f43a3..d58e111eb 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs @@ -279,7 +279,6 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.Task.AdvancedEncoderOptions = kvp.Value;
break;
-
// Preset Information
case "PresetBuildNumber":
preset.Version = kvp.Value;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index c0355a3bf..b7be8bfdc 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.Services.Presets using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -318,6 +319,7 @@ namespace HandBrakeWPF.Services.Presets catch (Exception exc)
{
// Do Nothing.
+ Debug.WriteLine(exc);
}
}
}
@@ -446,6 +448,7 @@ namespace HandBrakeWPF.Services.Presets catch (Exception exc)
{
// Do Nothing.
+ Debug.WriteLine(exc);
}
}
}
@@ -478,6 +481,7 @@ namespace HandBrakeWPF.Services.Presets catch (Exception exc)
{
// Do Nothing
+ Debug.WriteLine(exc);
}
}
@@ -500,6 +504,7 @@ namespace HandBrakeWPF.Services.Presets catch (Exception exc)
{
createBackup = true;
+ Debug.WriteLine(exc);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 7e6cc2525..768c127d6 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -19,19 +19,17 @@ namespace HandBrakeWPF.ViewModels using System.Windows;
using System.Windows.Media.Imaging;
- using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Encode;
using HandBrake.ApplicationServices.Services.Encode.EventArgs;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Model;
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
- using HandBrake.ApplicationServices.Services.Encode;
using HandBrakeWPF.Factories;
using HandBrakeWPF.Properties;
- using HandBrakeWPF.Services;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Queue.Model;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -126,15 +124,19 @@ namespace HandBrakeWPF.ViewModels /// <param name="userSettingService">
/// The user Setting Service.
/// </param>
- public StaticPreviewViewModel(IScan scanService, IUserSettingService userSettingService)
+ /// <param name="errorService">
+ /// The error Service.
+ /// </param>
+ public StaticPreviewViewModel(IScan scanService, IUserSettingService userSettingService, IErrorService errorService)
{
this.scanService = scanService;
this.selectedPreviewImage = 1;
- this.Title = Properties.Resources.Preview;
+ this.Title = Resources.Preview;
this.PreviewNotAvailable = true;
// Live Preview
this.userSettingService = userSettingService;
+ this.errorService = errorService;
this.encodeService = new LibEncode(); // Preview needs a seperate instance rather than the shared singleton. This could maybe do with being refactored at some point
this.Title = "Preview";
@@ -410,7 +412,7 @@ namespace HandBrakeWPF.ViewModels this.Task = task;
this.UpdatePreviewFrame();
this.DisplayName = "Picture Preview";
- this.Title = Properties.Resources.Preview;
+ this.Title = Resources.Preview;
this.ScannedSource = scannedSource;
}
@@ -446,6 +448,7 @@ namespace HandBrakeWPF.ViewModels catch (Exception exc)
{
PreviewNotAvailable = true;
+ Debug.WriteLine(exc);
}
if (image != null)
@@ -470,13 +473,13 @@ namespace HandBrakeWPF.ViewModels if (ea.NewSize.Width > workArea.Width)
{
this.Width = (int)Math.Round(workArea.Width, 0) - 20;
- this.Title = Properties.Resources.Preview_Scaled;
+ this.Title = Resources.Preview_Scaled;
}
if (ea.NewSize.Height > workArea.Height)
{
this.Height = (int)Math.Round(workArea.Height, 0) - 20;
- this.Title = Properties.Resources.Preview_Scaled;
+ this.Title = Resources.Preview_Scaled;
}
}
#endregion
@@ -514,21 +517,21 @@ namespace HandBrakeWPF.ViewModels catch (Exception)
{
this.IsEncoding = false;
- this.errorService.ShowMessageBox("Unable to delete previous preview file. You may need to restart the application.",
+ this.errorService.ShowMessageBox("Unable to delete previous preview file. You may need to restart the application.",
Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
}
if (this.Task == null || string.IsNullOrEmpty(Task.Source))
{
- this.errorService.ShowMessageBox("You must first scan a source and setup your encode before creating a preview.",
+ this.errorService.ShowMessageBox("You must first scan a source and setup your encode before creating a preview.",
Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
EncodeTask encodeTask = new EncodeTask(this.Task)
{
- PreviewEncodeDuration = this.Duration,
- PreviewEncodeStartAt = this.SelectedPreviewImage,
+ PreviewEncodeDuration = this.Duration,
+ PreviewEncodeStartAt = this.SelectedPreviewImage,
PointToPointMode = PointToPointMode.Preview
};
@@ -561,6 +564,7 @@ namespace HandBrakeWPF.ViewModels #endregion
#region Private Methods
+
/// <summary>
/// Play the Encoded file
/// </summary>
@@ -600,7 +604,7 @@ namespace HandBrakeWPF.ViewModels }
else
{
- this.errorService.ShowMessageBox("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\")",
+ this.errorService.ShowMessageBox("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\")",
Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
@@ -614,7 +618,7 @@ namespace HandBrakeWPF.ViewModels }
else
{
- this.errorService.ShowMessageBox("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.",
+ this.errorService.ShowMessageBox("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.",
Resources.Error, MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
@@ -631,7 +635,7 @@ namespace HandBrakeWPF.ViewModels // Make sure we are not already encoding and if we are then display an error.
if (encodeService.IsEncoding)
{
- this.errorService.ShowMessageBox("Handbrake is already encoding a video! Only one file can be encoded at any one time.",
+ this.errorService.ShowMessageBox("Handbrake is already encoding a video! Only one file can be encoded at any one time.",
Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
@@ -645,6 +649,7 @@ namespace HandBrakeWPF.ViewModels #endregion
#region Event Handlers
+
/// <summary>
/// Handle Encode Progress Events
/// </summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 33aa86be1..14c6a9899 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -667,7 +667,6 @@ namespace HandBrakeWPF.ViewModels SourceTrack = source,
};
-
// Burn-in Behaviours
if (this.SubtitleBehaviours.SelectedBurnInBehaviour == SubtitleBurnInBehaviourModes.ForeignAudio
|| this.SubtitleBehaviours.SelectedBurnInBehaviour == SubtitleBurnInBehaviourModes.ForeignAudioPreferred)
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 6d72d0590..47cc4f6a3 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -1220,7 +1220,6 @@ namespace HandBrakeWPF.ViewModels this.VideoLevel = VideoLevel.Auto;
}
-
// Setup Presets.
this.VideoPresets.Clear();
if (encoder.Presets != null)
@@ -1247,7 +1246,6 @@ namespace HandBrakeWPF.ViewModels // Update the Quality Slider. Make sure the bounds are up to date with the users settings.
this.SetQualitySliderBounds();
-
// Update control display
this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && this.UseAdvancedTab;
this.DisplayOptimiseOptions = this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X265 || this.SelectedVideoEncoder == VideoEncoder.QuickSync;
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index 7f8be26ab..fc5a141b9 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -73,7 +73,6 @@ namespace HandBrakeWPF.Views this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.G, ModifierKeys.Control | ModifierKeys.Shift)), new KeyGesture(Key.G, ModifierKeys.Control | ModifierKeys.Shift))); // Garbage Colleciton
this.InputBindings.Add(new InputBinding(new ProcessShortcutCommand(new KeyGesture(Key.F1, ModifierKeys.None)), new KeyGesture(Key.F1, ModifierKeys.None))); // Help
-
// Enable Windows 7 Taskbar progress indication.
if (this.TaskbarItemInfo == null)
{
|