diff options
author | sr55 <[email protected]> | 2015-05-03 17:18:59 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-05-03 17:18:59 +0000 |
commit | 0be4e18bacefa6b7bc63731b4a004a6ff772af20 (patch) | |
tree | 405ba4add7d0086d363a44e00a6b8a7ddc1c0163 /win/CS/HandBrake.ApplicationServices/Interop | |
parent | 6689ba81c2919ef34d85da357d4b56b90507824b (diff) |
WinGui: Some Model Re-factoring by RandomEngy
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7151 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
18 files changed, 638 insertions, 467 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs index abaa0fc25..741723329 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs @@ -15,6 +15,7 @@ namespace HandBrake.ApplicationServices.Interop.Factories using HandBrake.ApplicationServices.Interop.Json.Shared;
using HandBrake.ApplicationServices.Interop.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Interop.Model.Preview;
using HandBrake.ApplicationServices.Services.Encode.Model;
/// <summary>
@@ -51,10 +52,10 @@ namespace HandBrake.ApplicationServices.Interop.Factories {
int settingMode = (int)keepWidthOrHeight + (job.KeepDisplayAspect ? 0x04 : 0);
- // Sanatise the Geometry First.
+ // Sanitize the Geometry First.
AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
{
- SourceGeometry = new Geometry()
+ SourceGeometry = new Geometry
{
Width = title.Resolution.Width,
Height = title.Resolution.Height,
@@ -91,5 +92,58 @@ namespace HandBrake.ApplicationServices.Interop.Factories return HandBrakeUtils.GetAnamorphicSize(anamorphicGeometry);
}
+
+ /// <summary>
+ /// Finds output geometry for the given preview settings and title.
+ /// </summary>
+ /// <param name="settings">The preview settings.</param>
+ /// <param name="title">Information on the title to consider.</param>
+ /// <returns></returns>
+ public static Geometry CreateGeometry(PreviewSettings settings, SourceVideoInfo title)
+ {
+ int settingMode = settings.KeepDisplayAspect ? 0x04 : 0;
+
+ // Sanitize the Geometry First.
+ AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
+ {
+ SourceGeometry = new Geometry
+ {
+ Width = title.Resolution.Width,
+ Height = title.Resolution.Height,
+ PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height }
+ },
+ DestSettings = new DestSettings
+ {
+ AnamorphicMode = (int)settings.Anamorphic,
+ Geometry =
+ {
+ Width = settings.Width,
+ Height = settings.Height,
+ PAR = new PAR
+ {
+ Num = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : settings.PixelAspectX,
+ Den = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : settings.PixelAspectY,
+ }
+ },
+ Keep = settingMode,
+ Crop = new List<int> { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right },
+ Modulus = settings.Modulus ?? 16,
+ MaxWidth = settings.MaxWidth,
+ MaxHeight = settings.MaxHeight,
+ ItuPAR = false
+ }
+ };
+
+ if (settings.Anamorphic == Anamorphic.Custom)
+ {
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = settings.PixelAspectX, Den = settings.PixelAspectY };
+ }
+ else
+ {
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height };
+ }
+
+ return HandBrakeUtils.GetAnamorphicSize(anamorphicGeometry);
+ }
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs index 714de6547..69075a7f9 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs @@ -33,33 +33,33 @@ namespace HandBrake.ApplicationServices.Interop /// </summary>
private static List<HBVideoEncoder> videoEncoders;
- /// <summary>
- /// Video framerates in pts.
- /// </summary>
- private static List<HBRate> videoFramerates;
-
- /// <summary>
- /// List of HandBrake mixdowns.
+ /// <summary> + /// Video framerates in pts. + /// </summary> + private static List<HBRate> videoFramerates; + + /// <summary> + /// List of HandBrake mixdowns. /// </summary>
private static List<HBMixdown> mixdowns;
- /// <summary>
- /// List of HandBrake containers.
- /// </summary>
- private static List<HBContainer> containers;
-
- /// <summary>
- /// The audio bitrates.
+ /// <summary> + /// List of HandBrake containers. + /// </summary> + private static List<HBContainer> containers; + + /// <summary> + /// The audio bitrates. /// </summary>
private static List<int> audioBitrates;
- /// <summary>
- /// Audio sample rates in Hz.
- /// </summary>
- private static List<HBRate> audioSampleRates;
-
- /// <summary>
- /// Initializes static members of the HandBrakeEncoderHelpers class.
+ /// <summary> + /// Audio sample rates in Hz. + /// </summary> + private static List<HBRate> audioSampleRates; + + /// <summary> + /// Initializes static members of the HandBrakeEncoderHelpers class. /// </summary>
static HandBrakeEncoderHelpers()
{
@@ -109,13 +109,13 @@ namespace HandBrake.ApplicationServices.Interop {
videoFramerates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate);
}
-
- return videoFramerates;
- }
- }
-
- /// <summary>
- /// Gets a list of supported mixdowns.
+ + return videoFramerates; + } + } + + /// <summary> + /// Gets a list of supported mixdowns. /// </summary>
public static List<HBMixdown> Mixdowns
{
@@ -257,12 +257,73 @@ namespace HandBrake.ApplicationServices.Interop public static HBContainer GetContainer(string shortName)
{
return Containers.SingleOrDefault(c => c.ShortName == shortName);
- }
-
- /// <summary>
- /// Determines if the given encoder is compatible with the given track.
- /// </summary>
- /// <param name="codecId">
+ } + + /// <summary> + /// Returns true if the subtitle source type can be set to forced only. + /// </summary> + /// <param name="source">The subtitle source type (SSA, VobSub, etc)</param> + /// <returns>True if the subtitle source type can be set to forced only.</returns> + public static bool SubtitleCanSetForcedOnly(int source) + { + return HBFunctions.hb_subtitle_can_force(source) > 0; + } + + /// <summary> + /// Returns true if the subtitle source type can be burned in. + /// </summary> + /// <param name="source">The subtitle source type (SSA, VobSub, etc)</param> + /// <returns>True if the subtitle source type can be burned in.</returns> + public static bool SubtitleCanBurn(int source) + { + return HBFunctions.hb_subtitle_can_burn(source) > 0; + } + + /// <summary> + /// Returns true if the subtitle type can be passed through using the given muxer. + /// </summary> + /// <param name="subtitleSourceType">The subtitle source type (SSA, VobSub, etc)</param> + /// <param name="muxer">The ID of the muxer.</param> + /// <returns>True if the subtitle type can be passed through with the given muxer.</returns> + public static bool SubtitleCanPassthrough(int subtitleSourceType, int muxer) + { + return HBFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0; + } + + /// <summary> + /// Gets the subtitle source type's name. + /// </summary> + /// <param name="source">The subtitle source type (SSA, VobSub, etc).</param> + /// <returns>The name of the subtitle source.</returns> + public static string GetSubtitleSourceName(int source) + { + switch ((hb_subtitle_s_subsource)source) + { + case hb_subtitle_s_subsource.CC608SUB: + return "CC608"; + case hb_subtitle_s_subsource.CC708SUB: + return "CC708"; + case hb_subtitle_s_subsource.SRTSUB: + return "SRT"; + case hb_subtitle_s_subsource.SSASUB: + return "SSA"; + case hb_subtitle_s_subsource.TX3GSUB: + return "TX3G"; + case hb_subtitle_s_subsource.UTF8SUB: + return "UTF8"; + case hb_subtitle_s_subsource.VOBSUB: + return "VobSub"; + case hb_subtitle_s_subsource.PGSSUB: + return "PGS"; + default: + return string.Empty; + } + } + + /// <summary> + /// Determines if the given encoder is compatible with the given track. + /// </summary> + /// <param name="codecId"> /// The codec Id.
/// </param>
/// <param name="encoder">
@@ -307,13 +368,13 @@ namespace HandBrake.ApplicationServices.Interop /// </param>
/// <returns>
/// True if the encoder supports the mixdown.
- /// </returns>
- public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder)
- {
- return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint) encoder.Id) > 0;
- }
-
- /// <summary>
+ /// </returns> + public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) + { + return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint)encoder.Id) > 0; + } + + /// <summary> /// Determines if DRC can be applied to the given track with the given encoder.
/// </summary>
/// <param name="trackNumber">
@@ -428,15 +489,15 @@ namespace HandBrake.ApplicationServices.Interop int direction = 0;
HBFunctions.hb_video_quality_get_limits((uint)encoder.Id, ref low, ref high, ref granularity, ref direction);
-
- return new VideoQualityLimits
- {
- Low = low,
- High = high,
- Granularity = granularity,
- Ascending = direction == 0
- };
- }
+ + return new VideoQualityLimits + { + Low = low, + High = high, + Granularity = granularity, + Ascending = direction == 0 + }; + } /// <summary>
/// Sanitizes an audio bitrate given the output codec, sample rate and mixdown.
@@ -475,13 +536,13 @@ namespace HandBrake.ApplicationServices.Interop /// </param>
/// <returns>
/// The default bitrate for these parameters.
- /// </returns>
- public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
- {
- return HBFunctions.hb_audio_bitrate_get_default((uint) encoder.Id, sampleRate, mixdown.Id);
- }
-
- /// <summary>
+ /// </returns> + public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) + { + return HBFunctions.hb_audio_bitrate_get_default((uint)encoder.Id, sampleRate, mixdown.Id); + } + + /// <summary> /// Gets limits on audio quality for a given encoder.
/// </summary>
/// <param name="encoderId">
@@ -495,15 +556,15 @@ namespace HandBrake.ApplicationServices.Interop float low = 0, high = 0, granularity = 0;
int direction = 0;
HBFunctions.hb_audio_quality_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction);
-
- return new RangeLimits
- {
- Low = low,
- High = high,
- Granularity = granularity,
- Ascending = direction == 0
- };
- }
+ + return new RangeLimits + { + Low = low, + High = high, + Granularity = granularity, + Ascending = direction == 0 + }; + } /// <summary>
/// Gets limits on audio compression for a given encoder.
@@ -519,14 +580,14 @@ namespace HandBrake.ApplicationServices.Interop float low = 0, high = 0, granularity = 0;
int direction = 0;
HBFunctions.hb_audio_compression_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction);
-
- return new RangeLimits
- {
- Low = low,
- High = high,
- Granularity = granularity,
- Ascending = direction == 0
- };
- }
+ + return new RangeLimits + { + Low = low, + High = high, + Granularity = granularity, + Ascending = direction == 0 + }; + } }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index 9e89190cd..8aafbc02d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -61,6 +61,11 @@ namespace HandBrake.ApplicationServices.Interop private IntPtr hbHandle;
/// <summary>
+ /// The number of previews created during scan.
+ /// </summary>
+ private int previewCount;
+
+ /// <summary>
/// The timer to poll for scan status.
/// </summary>
private Timer scanPollTimer;
@@ -120,7 +125,18 @@ namespace HandBrake.ApplicationServices.Interop {
get
{
- return this.Handle;
+ return this.hbHandle;
+ }
+ }
+
+ /// <summary>
+ /// Gets the number of previews created during scan.
+ /// </summary>
+ public int PreviewCount
+ {
+ get
+ {
+ return this.previewCount;
}
}
@@ -200,6 +216,8 @@ namespace HandBrake.ApplicationServices.Interop /// </param>
public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex)
{
+ this.previewCount = previewCount;
+
IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path);
HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));
Marshal.FreeHGlobal(pathPtr);
@@ -237,7 +255,7 @@ namespace HandBrake.ApplicationServices.Interop /// <remarks>
/// Only incorporates sizing and aspect ratio into preview image.
/// </remarks>
- /// <param name="job">
+ /// <param name="settings">
/// The encode job to preview.
/// </param>
/// <param name="previewNumber">
@@ -247,41 +265,46 @@ namespace HandBrake.ApplicationServices.Interop /// An image with the requested preview.
/// </returns>
[HandleProcessCorruptedStateExceptions]
- public BitmapImage GetPreview(PreviewSettings job, int previewNumber)
+ public BitmapImage GetPreview(PreviewSettings settings, int previewNumber)
{
- SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == job.Title);
+ SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == settings.TitleNumber);
Validate.NotNull(title, "GetPreview: Title should not have been null. This is probably a bug.");
- // Creat the Expected Output Geometry details for libhb.
+ // Create the Expected Output Geometry details for libhb.
hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{
- crop = new[] { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
+ crop = new[] { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right },
itu_par = 0,
- keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (job.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
- maxWidth = job.MaxWidth ?? 0,
- maxHeight = job.MaxHeight ?? 0,
- mode = (int)(hb_anamorphic_mode_t)job.Anamorphic,
- modulus = job.Modulus ?? 16,
+ keep = settings.KeepDisplayAspect ? 0x04 : 0,
+ maxWidth = settings.MaxWidth,
+ maxHeight = settings.MaxHeight,
+ mode = (int)(hb_anamorphic_mode_t)settings.Anamorphic,
+ modulus = settings.Modulus ?? 16,
geometry = new hb_geometry_s
{
- height = job.Height ?? 0,
- width = job.Width ?? 0,
- par = job.Anamorphic != Anamorphic.Custom
+ height = settings.Height,
+ width = settings.Width,
+ par = settings.Anamorphic != Anamorphic.Custom
? new hb_rational_t { den = title.Geometry.PAR.Den, num = title.Geometry.PAR.Num }
- : new hb_rational_t { den = job.PixelAspectY, num = job.PixelAspectX }
+ : new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX }
}
};
- // Sanatise the input.
- Geometry resultGeometry = AnamorphicFactory.CreateGeometry(job, new SourceVideoInfo(new Size(title.Geometry.Width, title.Geometry.Height), new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)), AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH); // TODO this keep isn't right.
- int width = resultGeometry.Width * resultGeometry.PAR.Num / resultGeometry.PAR.Den;
+ // Sanitize the input.
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(
+ settings,
+ new SourceVideoInfo(
+ new Size(title.Geometry.Width, title.Geometry.Height),
+ new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)));
+ int width = resultGeometry.Width;
int height = resultGeometry.Height;
- uiGeometry.geometry.height = resultGeometry.Height; // Prased the height now.
- int outputWidth = width;
- int outputHeight = height;
-
+ uiGeometry.geometry.width = width;
+ uiGeometry.geometry.height = height;
+ uiGeometry.geometry.par.num = settings.PixelAspectX;
+ uiGeometry.geometry.par.den = settings.PixelAspectY;
+
// Fetch the image data from LibHb
- IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, job.Title, previewNumber, ref uiGeometry, 0);
+ IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, settings.TitleNumber, previewNumber, ref uiGeometry, 0);
hb_image_s image = InteropUtilities.ToStructureFromPtr<hb_image_s>(resultingImageStuct);
// Copy the filled image buffer to a managed array.
@@ -292,8 +315,8 @@ namespace HandBrake.ApplicationServices.Interop byte[] managedBuffer = new byte[imageBufferSize];
Marshal.Copy(image.plane[0].data, managedBuffer, 0, imageBufferSize);
- var bitmap = new Bitmap(outputWidth, outputHeight);
- BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, outputWidth, outputHeight), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb);
+ var bitmap = new Bitmap(width, height);
+ BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb);
IntPtr ptr = bitmapData.Scan0; // Pointer to the first pixel.
for (int i = 0; i < image.height; i++)
@@ -301,7 +324,7 @@ namespace HandBrake.ApplicationServices.Interop try
{
Marshal.Copy(managedBuffer, i * stride_width, ptr, stride_width);
- ptr = IntPtr.Add(ptr, outputWidth * 4);
+ ptr = IntPtr.Add(ptr, width * 4);
}
catch (Exception exc)
{
@@ -341,6 +364,18 @@ namespace HandBrake.ApplicationServices.Interop }
/// <summary>
+ /// Determines if DRC can be applied to the given track with the given encoder.
+ /// </summary>
+ /// <param name="trackNumber">The track Number.</param>
+ /// <param name="encoder">The encoder to use for DRC.</param>
+ /// <param name="title">The title.</param>
+ /// <returns>True if DRC can be applied to the track with the given encoder.</returns>
+ public bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title)
+ {
+ return HBFunctions.hb_audio_can_apply_drc2(this.hbHandle, title, trackNumber, encoder.Id) > 0;
+ }
+
+ /// <summary>
/// Starts an encode with the given job.
/// </summary>
/// <param name="encodeObject">
@@ -355,7 +390,6 @@ namespace HandBrake.ApplicationServices.Interop };
string encode = JsonConvert.SerializeObject(encodeObject, Formatting.Indented, settings);
- LogHelper.LogMessage(new LogMessage(encode, LogMessageType.encodeJson, LogLevel.debug));
HBFunctions.hb_add_json(this.hbHandle, InteropUtilities.ToUtf8PtrFromString(encode));
HBFunctions.hb_start(this.hbHandle);
@@ -432,6 +466,17 @@ namespace HandBrake.ApplicationServices.Interop }
/// <summary>
+ /// Gets a value indicating whether the object is disposed.
+ /// </summary>
+ public bool IsDisposed
+ {
+ get
+ {
+ return this.disposed;
+ }
+ }
+
+ /// <summary>
/// Frees any resources associated with this object.
/// </summary>
/// <param name="disposing">
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs index 7a00bb8e9..aad5df21c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs @@ -20,23 +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>
- /// Estimated overhead in bytes for each frame in output container.
- /// </summary>
- internal const int ContainerOverheadPerFrame = 6;
-
- /// <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.
@@ -294,25 +289,25 @@ namespace HandBrake.ApplicationServices.Interop 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/Audio.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs index 2661a8f17..4e4b61d6b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs @@ -19,7 +19,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// <summary>
/// Gets or sets the audio list.
/// </summary>
- public List<AudioList> AudioList { get; set; }
+ public List<AudioTrack> AudioList { get; set; }
/// <summary>
/// Gets or sets the copy mask.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioTrack.cs index 2f79ec7e6..0c628fbb0 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioList.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioTrack.cs @@ -1,77 +1,77 @@ // --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AudioList.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="AudioTrack.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 audio list.
+// Represents an audio track to encode.
// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Encode
-{
- /// <summary>
- /// The audio list.
- /// </summary>
- public class AudioList
- {
- /// <summary>
- /// Gets or sets the bitrate.
- /// </summary>
- public int? Bitrate { get; set; }
-
- /// <summary>
- /// Gets or sets the compression level.
- /// </summary>
- public double? CompressionLevel { get; set; }
-
- /// <summary>
- /// Gets or sets the drc.
- /// </summary>
- public double DRC { get; set; }
-
- /// <summary>
- /// Gets or sets the encoder.
- /// </summary>
- public int Encoder { get; set; }
-
- /// <summary>
- /// Gets or sets the gain.
- /// </summary>
- public double Gain { get; set; }
-
- /// <summary>
- /// Gets or sets the mixdown.
- /// </summary>
- public int Mixdown { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether normalize mix level.
- /// </summary>
- public bool NormalizeMixLevel { get; set; }
-
- /// <summary>
- /// Gets or sets the quality.
- /// </summary>
- public double? Quality { get; set; }
-
- /// <summary>
- /// Gets or sets the samplerate.
- /// </summary>
- public int Samplerate { get; set; }
-
- /// <summary>
- /// Gets or sets the Name of the audio track.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the track.
- /// </summary>
- public int Track { get; set; }
-
- /// <summary>
- /// Gets or sets the dither method.
- /// </summary>
- public int DitherMethod { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Encode +{ + /// <summary> + /// Represents an audio track to encode. + /// </summary> + public class AudioTrack + { + /// <summary> + /// Gets or sets the bitrate. + /// </summary> + public int? Bitrate { get; set; } + + /// <summary> + /// Gets or sets the compression level. + /// </summary> + public double? CompressionLevel { get; set; } + + /// <summary> + /// Gets or sets the drc. + /// </summary> + public double DRC { get; set; } + + /// <summary> + /// Gets or sets the encoder. + /// </summary> + public int Encoder { get; set; } + + /// <summary> + /// Gets or sets the gain. + /// </summary> + public double Gain { get; set; } + + /// <summary> + /// Gets or sets the mixdown. + /// </summary> + public int Mixdown { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether normalize mix level. + /// </summary> + public bool NormalizeMixLevel { get; set; } + + /// <summary> + /// Gets or sets the quality. + /// </summary> + public double? Quality { get; set; } + + /// <summary> + /// Gets or sets the samplerate. + /// </summary> + public int Samplerate { get; set; } + + /// <summary> + /// Gets or sets the Name of the audio track. + /// </summary> + public string Name { get; set; } + + /// <summary> + /// Gets or sets the track. + /// </summary> + public int Track { get; set; } + + /// <summary> + /// Gets or sets the dither method. + /// </summary> + public int DitherMethod { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Chapter.cs index d58146510..567d0e7a3 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/ChapterList.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Chapter.cs @@ -1,22 +1,22 @@ // --------------------------------------------------------------------------------------------------------------------
-// <copyright file="ChapterList.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="Chapter.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 chapter list.
+// Represents a chapter to encode.
// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Encode
-{
- /// <summary>
- /// The chapter list.
- /// </summary>
- public class ChapterList
- {
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- public string Name { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Encode +{ + /// <summary> + /// Represents a chapter to encode. + /// </summary> + public class Chapter + { + /// <summary> + /// Gets or sets the name. + /// </summary> + public string Name { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs index 42b3eaa40..9d22fb98a 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs @@ -19,7 +19,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// <summary>
/// Gets or sets the chapter list.
/// </summary>
- public List<ChapterList> ChapterList { get; set; }
+ public List<Chapter> ChapterList { get; set; }
/// <summary>
/// Gets or sets a value indicating whether chapter markers.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs index 9de1b8341..68baffcb4 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs @@ -39,7 +39,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// <summary>
/// Gets or sets the meta data.
/// </summary>
- public MetaData Metadata { get; set; }
+ public Metadata Metadata { get; set; }
/// <summary>
/// Gets or sets the sequence id.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs index 86f06b8cb..d840d5d7f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs @@ -12,7 +12,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// <summary>
/// The meta data.
/// </summary>
- public class MetaData
+ public class Metadata
{
/// <summary>
/// Gets or sets the album artist.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs index 71814c9e1..3a8aedec7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleList.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs @@ -1,52 +1,49 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="SubtitleList.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 subtitle list.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Encode
-{
- /// <summary>
- /// The subtitle list.
- /// </summary>
- public class SubtitleList
- {
- /// <summary>
- /// Gets or sets a value indicating whether burn.
- /// </summary>
- public bool Burn { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether default.
- /// </summary>
- public bool Default { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether force.
- /// </summary>
- public bool Forced { get; set; }
-
- /// <summary>
- /// Gets or sets the id.
- /// </summary>
- public int ID { get; set; }
-
- /// <summary>
- /// Gets or sets the offset.
- /// </summary>
- public int Offset { get; set; }
-
- /// <summary>
- /// Gets or sets the track.
- /// </summary>
- public int Track { get; set; }
-
- /// <summary>
- /// Gets or sets the srt.
- /// </summary>
- public SRT SRT { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- +// <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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Encode +{ + /// <summary> + /// Represents a subtitle track to encode. + /// </summary> + public class SubtitleTrack + { + /// <summary> + /// Gets or sets a value indicating whether burn. + /// </summary> + public bool Burn { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether default. + /// </summary> + public bool Default { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether force. + /// </summary> + public bool Forced { get; set; } + + /// <summary> + /// Gets or sets the id. + /// </summary> + public int ID { get; set; } + + /// <summary> + /// Gets or sets the offset. + /// </summary> + public int Offset { get; set; } + + /// <summary> + /// Gets or sets the track. + /// </summary> + public int Track { get; set; } + + /// <summary> + /// Gets or sets the srt. + /// </summary> + public SRT SRT { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs index 5d38ba51d..13439eaa7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs @@ -21,9 +21,9 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// </summary>
public SubtitleSearch Search { get; set; }
- /// <summary>
- /// Gets or sets the subtitle list.
- /// </summary>
- public List<SubtitleList> SubtitleList { get; set; }
- }
+ /// <summary> + /// Gets or sets the subtitle list. + /// </summary> + public List<SubtitleTrack> SubtitleList { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs index b0491c734..091f9a4f8 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs @@ -1,52 +1,49 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AudioTrack.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 audio list.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Scan
-{
- /// <summary>
- /// The audio list.
- /// </summary>
- public class AudioTrack
- {
- /// <summary>
- /// Gets or sets the bit rate.
- /// </summary>
- public int BitRate { get; set; }
-
- /// <summary>
- /// Gets or sets the channel layout.
- /// </summary>
- public int ChannelLayout { get; set; }
-
- /// <summary>
- /// Gets or sets the description.
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the language.
- /// </summary>
- public string Language { get; set; }
-
- /// <summary>
- /// Gets or sets the language code.
- /// </summary>
- public string LanguageCode { get; set; }
-
- /// <summary>
- /// Gets or sets the sample rate.
- /// </summary>
- public int SampleRate { get; set; }
-
- /// <summary>
- /// Gets or sets the codec.
- /// </summary>
- public int Codec { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- +// <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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Scan +{ + /// <summary> + /// An audio track from the source video. + /// </summary> + public class SourceAudioTrack + { + /// <summary> + /// Gets or sets the bit rate. + /// </summary> + public int BitRate { get; set; } + + /// <summary> + /// Gets or sets the channel layout. + /// </summary> + public int ChannelLayout { get; set; } + + /// <summary> + /// Gets or sets the description. + /// </summary> + public string Description { get; set; } + + /// <summary> + /// Gets or sets the language. + /// </summary> + public string Language { get; set; } + + /// <summary> + /// Gets or sets the language code. + /// </summary> + public string LanguageCode { get; set; } + + /// <summary> + /// Gets or sets the sample rate. + /// </summary> + public int SampleRate { get; set; } + + /// <summary> + /// Gets or sets the codec. + /// </summary> + public int Codec { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs index dc50f2dc8..fce479ff1 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/ChapterTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs @@ -1,27 +1,24 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="ChapterTrack.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 chapter list.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Scan
-{
- /// <summary>
- /// The chapter list.
- /// </summary>
- public class ChapterTrack
- {
- /// <summary>
- /// Gets or sets the duration.
- /// </summary>
- public Duration Duration { get; set; }
-
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- public string Name { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- +// <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> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Scan +{ + /// <summary> + /// The a chapter from a video source. + /// </summary> + public class SourceChapter + { + /// <summary> + /// Gets or sets the duration. + /// </summary> + public Duration Duration { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + public string Name { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceMetadata.cs index ecd26bd8f..f575dc637 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/MetaData.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceMetadata.cs @@ -1,18 +1,18 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="MetaData.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 meta data.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Scan
-{
- /// <summary>
- /// The meta data.
- /// </summary>
- public class MetaData
- {
- }
+// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="SourceMetadata.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 meta data. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Scan +{ + /// <summary> + /// The meta data. + /// </summary> + public class SourceMetadata + { + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceSubtitleTrack.cs index 247801468..3f3594a39 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceSubtitleTrack.cs @@ -1,37 +1,37 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <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>
-// The subtitle list.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Scan
-{
- /// <summary>
- /// The subtitle list.
- /// </summary>
- public class SubtitleTrack
- {
- /// <summary>
- /// Gets or sets the format.
- /// </summary>
- public int Format { get; set; }
-
- /// <summary>
- /// Gets or sets the language.
- /// </summary>
- public string Language { get; set; }
-
- /// <summary>
- /// Gets or sets the language code.
- /// </summary>
- public string LanguageCode { get; set; }
-
- /// <summary>
- /// Gets or sets the source.
- /// </summary>
- public int Source { get; set; }
- }
+// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="SourceSubtitleTrack.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 subtitle list. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.ApplicationServices.Interop.Json.Scan +{ + /// <summary> + /// The subtitle list. + /// </summary> + public class SourceSubtitleTrack + { + /// <summary> + /// Gets or sets the format. + /// </summary> + public int Format { get; set; } + + /// <summary> + /// Gets or sets the language. + /// </summary> + public string Language { get; set; } + + /// <summary> + /// Gets or sets the language code. + /// </summary> + public string LanguageCode { get; set; } + + /// <summary> + /// Gets or sets the source. + /// </summary> + public int Source { get; set; } + } }
\ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs index f70a15584..4947bbadb 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs @@ -23,18 +23,18 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// </summary>
public int AngleCount { get; set; }
- /// <summary>
- /// Gets or sets the audio list.
- /// </summary>
- public List<AudioTrack> AudioList { get; set; }
-
- /// <summary>
- /// Gets or sets the chapter list.
- /// </summary>
- public List<ChapterTrack> ChapterList { get; set; }
-
- /// <summary>
- /// Gets or sets the color.
+ /// <summary> + /// Gets or sets the audio list. + /// </summary> + public List<SourceAudioTrack> AudioList { get; set; } + + /// <summary> + /// Gets or sets the chapter list. + /// </summary> + public List<SourceChapter> ChapterList { get; set; } + + /// <summary> + /// Gets or sets the color. /// </summary>
public Color Color { get; set; }
@@ -68,13 +68,13 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// </summary>
public bool InterlaceDetected { get; set; }
- /// <summary>
- /// Gets or sets the meta data.
- /// </summary>
- public MetaData MetaData { get; set; }
-
- /// <summary>
- /// Gets or sets the name.
+ /// <summary> + /// Gets or sets the meta data. + /// </summary> + public SourceMetadata MetaData { get; set; } + + /// <summary> + /// Gets or sets the name. /// </summary>
public string Name { get; set; }
@@ -88,13 +88,13 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// </summary>
public int Playlist { get; set; }
- /// <summary>
- /// Gets or sets the subtitle list.
- /// </summary>
- public List<SubtitleTrack> SubtitleList { get; set; }
-
- /// <summary>
- /// Gets or sets the type.
+ /// <summary> + /// Gets or sets the subtitle list. + /// </summary> + public List<SourceSubtitleTrack> SubtitleList { get; set; } + + /// <summary> + /// Gets or sets the type. /// HB_DVD_TYPE = 0, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE
/// </summary>
public int Type { 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 e2a07d1cc..af1a166ce 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs @@ -6,27 +6,52 @@ // The preview settings.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Model.Preview
-{
- using HandBrake.ApplicationServices.Services.Encode.Model;
-
- /// <summary>
- /// The preview settings.
- /// </summary>
- public class PreviewSettings : EncodeTask
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="PreviewSettings"/> class.
- /// </summary>
- /// <param name="task">
- /// The task.
- /// </param>
- public PreviewSettings(EncodeTask task)
- : base(task)
- {
- }
-
- // TODO flesh this out into a proper model.
- }
-}
+ +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; } + } +} |