summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs12
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs38
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs18
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs54
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs1004
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs58
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs382
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs6
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs454
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs76
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs26
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs24
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs38
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs24
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs20
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs524
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs188
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs32
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/EncodeJob.cs78
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncodeRateType.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoding.cs128
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs20
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs14
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs16
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs10
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs88
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs38
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/OutputExtension.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs20
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs10
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs24
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs64
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/AudioTrack.cs164
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Chapter.cs42
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/InputType.cs16
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Subtitle.cs144
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/SubtitleSource.cs20
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Title.cs322
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/SrtSubtitle.cs10
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs44
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/VideoRangeType.cs54
51 files changed, 2261 insertions, 2261 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs
index 26d9b4f67..fa1ea14c3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs
@@ -15,10 +15,10 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
/// Encode Completed Event Args
/// </summary>
public class EncodeCompletedEventArgs : EventArgs
- {
- /// <summary>
- /// Gets or sets a value indicating whether an error occurred during the encode.
- /// </summary>
- public bool Error { get; set; }
- }
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether an error occurred during the encode.
+ /// </summary>
+ public bool Error { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs
index 245132016..4e8d15b06 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs
@@ -15,30 +15,30 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
/// Encode Progress Event Args
/// </summary>
public class EncodeProgressEventArgs : EventArgs
- {
- /// <summary>
- /// Gets or sets FractionComplete.
- /// </summary>
+ {
+ /// <summary>
+ /// Gets or sets FractionComplete.
+ /// </summary>
public double FractionComplete { get; set; }
- /// <summary>
- /// Gets or sets CurrentFrameRate.
- /// </summary>
+ /// <summary>
+ /// Gets or sets CurrentFrameRate.
+ /// </summary>
public double CurrentFrameRate { get; set; }
- /// <summary>
- /// Gets or sets AverageFrameRate.
- /// </summary>
+ /// <summary>
+ /// Gets or sets AverageFrameRate.
+ /// </summary>
public double AverageFrameRate { get; set; }
- /// <summary>
- /// Gets or sets EstimatedTimeLeft.
- /// </summary>
- public TimeSpan EstimatedTimeLeft { get; set; }
+ /// <summary>
+ /// Gets or sets EstimatedTimeLeft.
+ /// </summary>
+ public TimeSpan EstimatedTimeLeft { get; set; }
- /// <summary>
- /// Gets or sets the current encoding pass. (-1: subtitle scan, 1: first pass, 2: second pass)
- /// </summary>
- public int Pass { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the current encoding pass. (-1: subtitle scan, 1: first pass, 2: second pass)
+ /// </summary>
+ public int Pass { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs
index 432b1da59..e547a2fe8 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs
@@ -12,13 +12,13 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
using System;
/// <summary>
- /// The Message Logged Event Args
- /// </summary>
- public class MessageLoggedEventArgs : EventArgs
- {
- /// <summary>
- /// Gets or sets Message.
- /// </summary>
- public string Message { get; set; }
- }
+ /// The Message Logged Event Args
+ /// </summary>
+ public class MessageLoggedEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Gets or sets Message.
+ /// </summary>
+ public string Message { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs
index f58a04c0b..3928a53e6 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs
@@ -9,36 +9,36 @@
namespace HandBrake.ApplicationServices.Interop.EventArgs
{
- using System;
+ using System;
- /// <summary>
- /// The Scan Progress Event Args
- /// </summary>
- public class ScanProgressEventArgs : EventArgs
- {
- /// <summary>
- /// Gets or sets the total progress fraction for the scan.
- /// </summary>
- public double Progress { get; set; }
+ /// <summary>
+ /// The Scan Progress Event Args
+ /// </summary>
+ public class ScanProgressEventArgs : EventArgs
+ {
+ /// <summary>
+ /// Gets or sets the total progress fraction for the scan.
+ /// </summary>
+ public double Progress { get; set; }
- /// <summary>
- /// Gets or sets the current preview being processed on the scan.
- /// </summary>
- public int CurrentPreview { get; set; }
+ /// <summary>
+ /// Gets or sets the current preview being processed on the scan.
+ /// </summary>
+ public int CurrentPreview { get; set; }
- /// <summary>
- /// Gets or sets the total number of previews to process.
- /// </summary>
- public int Previews { get; set; }
+ /// <summary>
+ /// Gets or sets the total number of previews to process.
+ /// </summary>
+ public int Previews { get; set; }
- /// <summary>
- /// Gets or sets the current title being processed on the scan.
- /// </summary>
- public int CurrentTitle { get; set; }
+ /// <summary>
+ /// Gets or sets the current title being processed on the scan.
+ /// </summary>
+ public int CurrentTitle { get; set; }
- /// <summary>
- /// Gets or sets the total number of titles to process.
- /// </summary>
- public int Titles { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the total number of titles to process.
+ /// </summary>
+ public int Titles { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
index c0a4195f9..35d278a4a 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs
@@ -20,514 +20,514 @@ namespace HandBrake.ApplicationServices.Interop
using HandBrake.ApplicationServices.Interop.Model.Scan;
/// <summary>
- /// The encoders.
- /// </summary>
- public static class HandBrakeEncoderHelpers
- {
- /// <summary>
- /// The audio encoders.
- /// </summary>
- private static List<HBAudioEncoder> audioEncoders;
-
- /// <summary>
- /// The video encoders.
- /// </summary>
- private static List<HBVideoEncoder> videoEncoders;
-
- /// <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>
- private static List<int> audioBitrates;
-
- /// <summary>
- /// Audio sample rates in Hz.
- /// </summary>
- private static List<HBRate> audioSampleRates;
-
- /// <summary>
+ /// The encoders.
+ /// </summary>
+ public static class HandBrakeEncoderHelpers
+ {
+ /// <summary>
+ /// The audio encoders.
+ /// </summary>
+ private static List<HBAudioEncoder> audioEncoders;
+
+ /// <summary>
+ /// The video encoders.
+ /// </summary>
+ private static List<HBVideoEncoder> videoEncoders;
+
+ /// <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>
+ 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>
+ /// </summary>
static HandBrakeEncoderHelpers()
- {
- HandBrakeUtils.EnsureGlobalInit();
- }
-
- /// <summary>
- /// Gets a list of supported audio encoders.
- /// </summary>
- public static List<HBAudioEncoder> AudioEncoders
- {
- get
- {
- if (audioEncoders == null)
- {
+ {
+ HandBrakeUtils.EnsureGlobalInit();
+ }
+
+ /// <summary>
+ /// Gets a list of supported audio encoders.
+ /// </summary>
+ public static List<HBAudioEncoder> AudioEncoders
+ {
+ get
+ {
+ if (audioEncoders == null)
+ {
audioEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBAudioEncoder>(HBFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder);
- }
-
- return audioEncoders;
- }
- }
-
- /// <summary>
- /// Gets a list of supported video encoders.
- /// </summary>
- public static List<HBVideoEncoder> VideoEncoders
- {
- get
- {
- if (videoEncoders == null)
- {
+ }
+
+ return audioEncoders;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported video encoders.
+ /// </summary>
+ public static List<HBVideoEncoder> VideoEncoders
+ {
+ get
+ {
+ if (videoEncoders == null)
+ {
videoEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBVideoEncoder>(HBFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder);
- }
-
- return videoEncoders;
- }
- }
-
- /// <summary>
- /// Gets a list of supported video framerates (in pts).
- /// </summary>
- public static List<HBRate> VideoFramerates
- {
- get
- {
- if (videoFramerates == null)
- {
+ }
+
+ return videoEncoders;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported video framerates (in pts).
+ /// </summary>
+ public static List<HBRate> VideoFramerates
+ {
+ get
+ {
+ if (videoFramerates == null)
+ {
videoFramerates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate);
- }
-
- return videoFramerates;
- }
- }
-
- /// <summary>
- /// Gets a list of supported mixdowns.
- /// </summary>
- public static List<HBMixdown> Mixdowns
- {
- get
- {
- if (mixdowns == null)
- {
+ }
+
+ return videoFramerates;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported mixdowns.
+ /// </summary>
+ public static List<HBMixdown> Mixdowns
+ {
+ get
+ {
+ if (mixdowns == null)
+ {
mixdowns = InteropUtilities.ToListFromIterator<hb_mixdown_s, HBMixdown>(HBFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown);
- }
-
- return mixdowns;
- }
- }
-
- /// <summary>
- /// Gets a list of supported audio bitrates.
- /// </summary>
- public static List<int> AudioBitrates
- {
- get
- {
- if (audioBitrates == null)
- {
- audioBitrates = InteropUtilities.ToListFromIterator<hb_rate_s, int>(HBFunctions.hb_audio_bitrate_get_next, b => b.rate);
- }
-
- return audioBitrates;
- }
- }
-
- /// <summary>
- /// Gets a list of supported audio sample rates (in Hz).
- /// </summary>
- public static List<HBRate> AudioSampleRates
- {
- get
- {
- if (audioSampleRates == null)
- {
+ }
+
+ return mixdowns;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported audio bitrates.
+ /// </summary>
+ public static List<int> AudioBitrates
+ {
+ get
+ {
+ if (audioBitrates == null)
+ {
+ audioBitrates = InteropUtilities.ToListFromIterator<hb_rate_s, int>(HBFunctions.hb_audio_bitrate_get_next, b => b.rate);
+ }
+
+ return audioBitrates;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported audio sample rates (in Hz).
+ /// </summary>
+ public static List<HBRate> AudioSampleRates
+ {
+ get
+ {
+ if (audioSampleRates == null)
+ {
audioSampleRates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate);
- }
-
- return audioSampleRates;
- }
- }
-
- /// <summary>
- /// Gets a list of supported containers.
- /// </summary>
- public static List<HBContainer> Containers
- {
- get
- {
- if (containers == null)
- {
+ }
+
+ return audioSampleRates;
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of supported containers.
+ /// </summary>
+ public static List<HBContainer> Containers
+ {
+ get
+ {
+ if (containers == null)
+ {
containers = InteropUtilities.ToListFromIterator<hb_container_s, HBContainer>(HBFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer);
- }
-
- return containers;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether SRT subtitles can be burnt in.
- /// </summary>
- public static bool CanBurnSrt
- {
- get
- {
- return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0;
- }
- }
-
- /// <summary>
- /// Gets the audio encoder with the specified short name.
- /// </summary>
- /// <param name="shortName">
- /// The name of the audio encoder.
- /// </param>
- /// <returns>
- /// The requested audio encoder.
- /// </returns>
- public static HBAudioEncoder GetAudioEncoder(string shortName)
- {
- return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName);
- }
-
- /// <summary>
- /// Gets the audio encoder with the specified codec ID.
- /// </summary>
- /// <param name="codecId">
- /// The ID of the audio encoder.
- /// </param>
- /// <returns>
- /// The requested audio encoder.
- /// </returns>
- public static HBAudioEncoder GetAudioEncoder(int codecId)
- {
- return AudioEncoders.SingleOrDefault(e => e.Id == codecId);
- }
-
- /// <summary>
- /// Gets the video encoder with the specified short name.
- /// </summary>
- /// <param name="shortName">
- /// The name of the video encoder.
- /// </param>
- /// <returns>
- /// The requested video encoder.
- /// </returns>
- public static HBVideoEncoder GetVideoEncoder(string shortName)
- {
- return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName);
- }
-
- /// <summary>
- /// Gets the mixdown with the specified short name.
- /// </summary>
- /// <param name="shortName">
- /// The name of the mixdown.
- /// </param>
- /// <returns>
- /// The requested mixdown.
- /// </returns>
- public static HBMixdown GetMixdown(string shortName)
- {
- return Mixdowns.SingleOrDefault(m => m.ShortName == shortName);
- }
-
- /// <summary>
- /// Gets the container with the specified short name.
- /// </summary>
- /// <param name="shortName">
- /// The name of the container.
- /// </param>
- /// <returns>
- /// The requested container.
- /// </returns>
- 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="track">
- /// The audio track to examine.
- /// </param>
- /// <param name="encoder">
- /// The encoder to examine.
- /// </param>
- /// <returns>
- /// True if the given encoder is comatible with the given audio track.
- /// </returns>
- /// <remarks>
- /// Only works with passthrough encoders.
- /// </remarks>
- public static bool AudioEncoderIsCompatible(AudioTrack track, HBAudioEncoder encoder)
- {
- return (track.CodecId & encoder.Id) > 0;
- }
-
- /// <summary>
- /// Determines if the given mixdown supports the given channel layout.
- /// </summary>
- /// <param name="mixdown">
- /// The mixdown to evaluate.
- /// </param>
- /// <param name="layout">
- /// The channel layout to evaluate.
- /// </param>
- /// <returns>
- /// True if the mixdown supports the given channel layout.
- /// </returns>
- public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout)
- {
- return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0;
- }
-
- /// <summary>
- /// Determines if the given encoder supports the given mixdown.
- /// </summary>
- /// <param name="mixdown">
- /// The mixdown to evaluate.
- /// </param>
- /// <param name="encoder">
- /// The encoder to evaluate.
- /// </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>
- /// Determines if DRC can be applied to the given track with the given encoder.
- /// </summary>
- /// <param name="track">
- /// The track to apply DRC to.
- /// </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 static bool CanApplyDrc(AudioTrack track, HBAudioEncoder encoder, int title)
- {
- return HBFunctions.hb_audio_can_apply_drc2(HandBrakeInstanceManager.LastScanHandle, title, track.TrackNumber, encoder.Id) > 0;
- }
-
- /// <summary>
- /// Determines if the given input audio codec can be passed through.
- /// </summary>
- /// <param name="codecId">
- /// The input codec to consider.
- /// </param>
- /// <returns>
- /// True if the codec can be passed through.
- /// </returns>
- public static bool CanPassthroughAudio(int codecId)
- {
- return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0;
- }
-
- /// <summary>
- /// Sanitizes a mixdown given the output codec and input channel layout.
- /// </summary>
- /// <param name="mixdown">
- /// The desired mixdown.
- /// </param>
- /// <param name="encoder">
- /// The output encoder to be used.
- /// </param>
- /// <param name="layout">
- /// The input channel layout.
- /// </param>
- /// <returns>
- /// A sanitized mixdown value.
- /// </returns>
- public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout)
- {
- int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id);
- return Mixdowns.Single(m => m.Id == sanitizedMixdown);
- }
-
- /// <summary>
- /// Gets the default mixdown for the given audio encoder and channel layout.
- /// </summary>
- /// <param name="encoder">
- /// The output codec to be used.
- /// </param>
- /// <param name="layout">
- /// The input channel layout.
- /// </param>
- /// <returns>
- /// The default mixdown for the given codec and channel layout.
- /// </returns>
- public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout)
- {
- int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout);
- return Mixdowns.Single(m => m.Id == defaultMixdown);
- }
-
- /// <summary>
- /// Gets the bitrate limits for the given audio codec, sample rate and mixdown.
- /// </summary>
- /// <param name="encoder">
- /// The audio encoder used.
- /// </param>
- /// <param name="sampleRate">
- /// The sample rate used (Hz).
- /// </param>
- /// <param name="mixdown">
- /// The mixdown used.
- /// </param>
- /// <returns>
- /// Limits on the audio bitrate for the given settings.
- /// </returns>
- public static BitrateLimits GetBitrateLimits(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
- {
- int low = 0;
- int high = 0;
-
- HBFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high);
-
- return new BitrateLimits { Low = low, High = high };
- }
-
- /// <summary>
- /// Gets the video quality limits for the given video codec.
- /// </summary>
- /// <param name="encoder">
- /// The video encoder to check.
- /// </param>
- /// <returns>
- /// Limits on the video quality for the encoder.
- /// </returns>
- public static VideoQualityLimits GetVideoQualityLimits(HBVideoEncoder encoder)
- {
- float low = 0;
- float high = 0;
- float granularity = 0;
- 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
- };
- }
-
- /// <summary>
- /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown.
- /// </summary>
- /// <param name="audioBitrate">
- /// The desired audio bitrate.
- /// </param>
- /// <param name="encoder">
- /// The output encoder to be used.
- /// </param>
- /// <param name="sampleRate">
- /// The output sample rate to be used.
- /// </param>
- /// <param name="mixdown">
- /// The mixdown to be used.
- /// </param>
- /// <returns>
- /// A sanitized audio bitrate.
- /// </returns>
- public static int SanitizeAudioBitrate(int audioBitrate, HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
- {
- return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id);
- }
-
- /// <summary>
- /// Gets the default audio bitrate for the given parameters.
- /// </summary>
- /// <param name="encoder">
- /// The encoder to use.
- /// </param>
- /// <param name="sampleRate">
- /// The sample rate to use.
- /// </param>
- /// <param name="mixdown">
- /// The mixdown to use.
- /// </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>
- /// Gets limits on audio quality for a given encoder.
- /// </summary>
- /// <param name="encoderId">
- /// The audio encoder ID.
- /// </param>
- /// <returns>
- /// Limits on the audio quality for the given encoder.
- /// </returns>
- internal static RangeLimits GetAudioQualityLimits(int encoderId)
- {
- 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
- };
- }
-
- /// <summary>
- /// Gets limits on audio compression for a given encoder.
- /// </summary>
- /// <param name="encoderId">
- /// The audio encoder ID.
- /// </param>
- /// <returns>
- /// Limits on the audio compression for the given encoder.
- /// </returns>
- internal static RangeLimits GetAudioCompressionLimits(int encoderId)
- {
- 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 containers;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether SRT subtitles can be burnt in.
+ /// </summary>
+ public static bool CanBurnSrt
+ {
+ get
+ {
+ return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets the audio encoder with the specified short name.
+ /// </summary>
+ /// <param name="shortName">
+ /// The name of the audio encoder.
+ /// </param>
+ /// <returns>
+ /// The requested audio encoder.
+ /// </returns>
+ public static HBAudioEncoder GetAudioEncoder(string shortName)
+ {
+ return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName);
+ }
+
+ /// <summary>
+ /// Gets the audio encoder with the specified codec ID.
+ /// </summary>
+ /// <param name="codecId">
+ /// The ID of the audio encoder.
+ /// </param>
+ /// <returns>
+ /// The requested audio encoder.
+ /// </returns>
+ public static HBAudioEncoder GetAudioEncoder(int codecId)
+ {
+ return AudioEncoders.SingleOrDefault(e => e.Id == codecId);
+ }
+
+ /// <summary>
+ /// Gets the video encoder with the specified short name.
+ /// </summary>
+ /// <param name="shortName">
+ /// The name of the video encoder.
+ /// </param>
+ /// <returns>
+ /// The requested video encoder.
+ /// </returns>
+ public static HBVideoEncoder GetVideoEncoder(string shortName)
+ {
+ return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName);
+ }
+
+ /// <summary>
+ /// Gets the mixdown with the specified short name.
+ /// </summary>
+ /// <param name="shortName">
+ /// The name of the mixdown.
+ /// </param>
+ /// <returns>
+ /// The requested mixdown.
+ /// </returns>
+ public static HBMixdown GetMixdown(string shortName)
+ {
+ return Mixdowns.SingleOrDefault(m => m.ShortName == shortName);
+ }
+
+ /// <summary>
+ /// Gets the container with the specified short name.
+ /// </summary>
+ /// <param name="shortName">
+ /// The name of the container.
+ /// </param>
+ /// <returns>
+ /// The requested container.
+ /// </returns>
+ 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="track">
+ /// The audio track to examine.
+ /// </param>
+ /// <param name="encoder">
+ /// The encoder to examine.
+ /// </param>
+ /// <returns>
+ /// True if the given encoder is comatible with the given audio track.
+ /// </returns>
+ /// <remarks>
+ /// Only works with passthrough encoders.
+ /// </remarks>
+ public static bool AudioEncoderIsCompatible(AudioTrack track, HBAudioEncoder encoder)
+ {
+ return (track.CodecId & encoder.Id) > 0;
+ }
+
+ /// <summary>
+ /// Determines if the given mixdown supports the given channel layout.
+ /// </summary>
+ /// <param name="mixdown">
+ /// The mixdown to evaluate.
+ /// </param>
+ /// <param name="layout">
+ /// The channel layout to evaluate.
+ /// </param>
+ /// <returns>
+ /// True if the mixdown supports the given channel layout.
+ /// </returns>
+ public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout)
+ {
+ return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0;
+ }
+
+ /// <summary>
+ /// Determines if the given encoder supports the given mixdown.
+ /// </summary>
+ /// <param name="mixdown">
+ /// The mixdown to evaluate.
+ /// </param>
+ /// <param name="encoder">
+ /// The encoder to evaluate.
+ /// </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>
+ /// Determines if DRC can be applied to the given track with the given encoder.
+ /// </summary>
+ /// <param name="track">
+ /// The track to apply DRC to.
+ /// </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 static bool CanApplyDrc(AudioTrack track, HBAudioEncoder encoder, int title)
+ {
+ return HBFunctions.hb_audio_can_apply_drc2(HandBrakeInstanceManager.LastScanHandle, title, track.TrackNumber, encoder.Id) > 0;
+ }
+
+ /// <summary>
+ /// Determines if the given input audio codec can be passed through.
+ /// </summary>
+ /// <param name="codecId">
+ /// The input codec to consider.
+ /// </param>
+ /// <returns>
+ /// True if the codec can be passed through.
+ /// </returns>
+ public static bool CanPassthroughAudio(int codecId)
+ {
+ return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0;
+ }
+
+ /// <summary>
+ /// Sanitizes a mixdown given the output codec and input channel layout.
+ /// </summary>
+ /// <param name="mixdown">
+ /// The desired mixdown.
+ /// </param>
+ /// <param name="encoder">
+ /// The output encoder to be used.
+ /// </param>
+ /// <param name="layout">
+ /// The input channel layout.
+ /// </param>
+ /// <returns>
+ /// A sanitized mixdown value.
+ /// </returns>
+ public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout)
+ {
+ int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id);
+ return Mixdowns.Single(m => m.Id == sanitizedMixdown);
+ }
+
+ /// <summary>
+ /// Gets the default mixdown for the given audio encoder and channel layout.
+ /// </summary>
+ /// <param name="encoder">
+ /// The output codec to be used.
+ /// </param>
+ /// <param name="layout">
+ /// The input channel layout.
+ /// </param>
+ /// <returns>
+ /// The default mixdown for the given codec and channel layout.
+ /// </returns>
+ public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout)
+ {
+ int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout);
+ return Mixdowns.Single(m => m.Id == defaultMixdown);
+ }
+
+ /// <summary>
+ /// Gets the bitrate limits for the given audio codec, sample rate and mixdown.
+ /// </summary>
+ /// <param name="encoder">
+ /// The audio encoder used.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The sample rate used (Hz).
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown used.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio bitrate for the given settings.
+ /// </returns>
+ public static BitrateLimits GetBitrateLimits(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
+ {
+ int low = 0;
+ int high = 0;
+
+ HBFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high);
+
+ return new BitrateLimits { Low = low, High = high };
+ }
+
+ /// <summary>
+ /// Gets the video quality limits for the given video codec.
+ /// </summary>
+ /// <param name="encoder">
+ /// The video encoder to check.
+ /// </param>
+ /// <returns>
+ /// Limits on the video quality for the encoder.
+ /// </returns>
+ public static VideoQualityLimits GetVideoQualityLimits(HBVideoEncoder encoder)
+ {
+ float low = 0;
+ float high = 0;
+ float granularity = 0;
+ 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
+ };
+ }
+
+ /// <summary>
+ /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown.
+ /// </summary>
+ /// <param name="audioBitrate">
+ /// The desired audio bitrate.
+ /// </param>
+ /// <param name="encoder">
+ /// The output encoder to be used.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The output sample rate to be used.
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown to be used.
+ /// </param>
+ /// <returns>
+ /// A sanitized audio bitrate.
+ /// </returns>
+ public static int SanitizeAudioBitrate(int audioBitrate, HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown)
+ {
+ return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id);
+ }
+
+ /// <summary>
+ /// Gets the default audio bitrate for the given parameters.
+ /// </summary>
+ /// <param name="encoder">
+ /// The encoder to use.
+ /// </param>
+ /// <param name="sampleRate">
+ /// The sample rate to use.
+ /// </param>
+ /// <param name="mixdown">
+ /// The mixdown to use.
+ /// </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>
+ /// Gets limits on audio quality for a given encoder.
+ /// </summary>
+ /// <param name="encoderId">
+ /// The audio encoder ID.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio quality for the given encoder.
+ /// </returns>
+ internal static RangeLimits GetAudioQualityLimits(int encoderId)
+ {
+ 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
+ };
+ }
+
+ /// <summary>
+ /// Gets limits on audio compression for a given encoder.
+ /// </summary>
+ /// <param name="encoderId">
+ /// The audio encoder ID.
+ /// </param>
+ /// <returns>
+ /// Limits on the audio compression for the given encoder.
+ /// </returns>
+ internal static RangeLimits GetAudioCompressionLimits(int encoderId)
+ {
+ 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
+ };
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs
index 7d059f047..b77c2b9a6 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs
@@ -16,37 +16,37 @@ namespace HandBrake.ApplicationServices.Interop
using HandBrake.ApplicationServices.Interop.Model;
/// <summary>
- /// Contains utilities for converting language codes.
- /// </summary>
- public static class Languages
- {
- /// <summary>
- /// The list of all languages.
- /// </summary>
- private static IList<Language> allLanguages;
+ /// Contains utilities for converting language codes.
+ /// </summary>
+ public static class Languages
+ {
+ /// <summary>
+ /// The list of all languages.
+ /// </summary>
+ private static IList<Language> allLanguages;
- /// <summary>
- /// Gets a list of all languages.
- /// </summary>
- public static IList<Language> AllLanguages
- {
- get
- {
- return allLanguages
- ?? (allLanguages =
+ /// <summary>
+ /// Gets a list of all languages.
+ /// </summary>
+ public static IList<Language> AllLanguages
+ {
+ get
+ {
+ return allLanguages
+ ?? (allLanguages =
InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage));
- }
- }
+ }
+ }
- /// <summary>
- /// Gets the language object for the given code.
- /// </summary>
- /// <param name="code">The ISO-639-2 code for the language.</param>
- /// <returns>Object that describes the language.</returns>
- public static Language Get(string code)
- {
- iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(HBFunctions.lang_for_code2(code));
+ /// <summary>
+ /// Gets the language object for the given code.
+ /// </summary>
+ /// <param name="code">The ISO-639-2 code for the language.</param>
+ /// <returns>Object that describes the language.</returns>
+ public static Language Get(string code)
+ {
+ iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(HBFunctions.lang_for_code2(code));
return HandBrakeUnitConversionHelpers.NativeToLanguage(language);
- }
- }
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs
index ab66617fc..758cfd302 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs
@@ -19,202 +19,202 @@ namespace HandBrake.ApplicationServices.Interop
using HandBrake.ApplicationServices.Interop.Model.Encoding;
/// <summary>
- /// Converters for various encoding values.
- /// </summary>
+ /// Converters for various encoding values.
+ /// </summary>
public static class HandBrakeUnitConversionHelpers
- {
- /// <summary>
- /// Video Frame Rates
- /// </summary>
- private static readonly Dictionary<double, int> VideoRates;
+ {
+ /// <summary>
+ /// Video Frame Rates
+ /// </summary>
+ private static readonly Dictionary<double, int> VideoRates;
- /// <summary>
+ /// <summary>
/// Initializes static members of the HandBrakeUnitConversionHelpers class.
- /// </summary>
+ /// </summary>
static HandBrakeUnitConversionHelpers()
- {
- HandBrakeUtils.EnsureGlobalInit();
+ {
+ HandBrakeUtils.EnsureGlobalInit();
- VideoRates = new Dictionary<double, int>();
+ VideoRates = new Dictionary<double, int>();
foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates)
- {
- VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate);
- }
- }
-
- /// <summary>
- /// Convert Framerate to Video Rates
- /// </summary>
- /// <param name="framerate">
- /// The framerate.
- /// </param>
- /// <returns>
- /// The vrate if a valid framerate is passed in.
- /// </returns>
- /// <exception cref="ArgumentException">
- /// Thrown when framerate is invalid.
- /// </exception>
- public static int FramerateToVrate(double framerate)
- {
- if (!VideoRates.ContainsKey(framerate))
- {
- throw new ArgumentException("Framerate not recognized.", "framerate");
- }
-
- return VideoRates[framerate];
- }
-
- /// <summary>
- /// Converts a native HB encoder structure to an Encoder model.
- /// </summary>
- /// <param name="encoder">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted model.
- /// </returns>
- public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
- {
- return new HBVideoEncoder
- {
- Id = encoder.codec,
- ShortName = encoder.short_name,
- DisplayName = encoder.name,
- CompatibleContainers = encoder.muxers
- };
- }
-
- /// <summary>
- /// Converts a native HB encoder structure to an Encoder model.
- /// </summary>
- /// <param name="encoder">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted model.
- /// </returns>
- public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
- {
- var result = new HBAudioEncoder
- {
- Id = encoder.codec,
- ShortName = encoder.short_name,
- DisplayName = encoder.name,
- CompatibleContainers = encoder.muxers,
+ {
+ VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate);
+ }
+ }
+
+ /// <summary>
+ /// Convert Framerate to Video Rates
+ /// </summary>
+ /// <param name="framerate">
+ /// The framerate.
+ /// </param>
+ /// <returns>
+ /// The vrate if a valid framerate is passed in.
+ /// </returns>
+ /// <exception cref="ArgumentException">
+ /// Thrown when framerate is invalid.
+ /// </exception>
+ public static int FramerateToVrate(double framerate)
+ {
+ if (!VideoRates.ContainsKey(framerate))
+ {
+ throw new ArgumentException("Framerate not recognized.", "framerate");
+ }
+
+ return VideoRates[framerate];
+ }
+
+ /// <summary>
+ /// Converts a native HB encoder structure to an Encoder model.
+ /// </summary>
+ /// <param name="encoder">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
+ public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
+ {
+ return new HBVideoEncoder
+ {
+ Id = encoder.codec,
+ ShortName = encoder.short_name,
+ DisplayName = encoder.name,
+ CompatibleContainers = encoder.muxers
+ };
+ }
+
+ /// <summary>
+ /// Converts a native HB encoder structure to an Encoder model.
+ /// </summary>
+ /// <param name="encoder">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
+ public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
+ {
+ var result = new HBAudioEncoder
+ {
+ Id = encoder.codec,
+ ShortName = encoder.short_name,
+ DisplayName = encoder.name,
+ CompatibleContainers = encoder.muxers,
QualityLimits = HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec),
- DefaultQuality = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
- CompressionLimits = HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec),
- DefaultCompression =
- HBFunctions.hb_audio_compression_get_default((uint)encoder.codec)
- };
-
- return result;
- }
-
- /// <summary>
- /// Converts a native HB rate structure to an HBRate object.
- /// </summary>
- /// <param name="rate">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted rate object.
- /// </returns>
- public static HBRate NativeToRate(hb_rate_s rate)
- {
- return new HBRate
- {
- Name = rate.name,
- Rate = rate.rate
- };
- }
-
- /// <summary>
- /// Converts a native HB mixdown structure to a Mixdown model.
- /// </summary>
- /// <param name="mixdown">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted model.
- /// </returns>
- public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)
- {
- return new HBMixdown
- {
- Id = mixdown.amixdown,
- ShortName = mixdown.short_name,
- DisplayName = mixdown.name
- };
- }
-
- /// <summary>
- /// Converts a native HB container structure into an HBContainer object.
- /// </summary>
- /// <param name="container">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted structure.
- /// </returns>
- public static HBContainer NativeToContainer(hb_container_s container)
- {
- return new HBContainer
- {
- DisplayName = container.name,
- ShortName = container.short_name,
- DefaultExtension = container.default_extension,
- Id = container.format
- };
- }
-
- /// <summary>
- /// Converts a native language structure to a Language object.
- /// </summary>
- /// <param name="language">
- /// The structure to convert.
- /// </param>
- /// <returns>
- /// The converted structure.
- /// </returns>
- public static Language NativeToLanguage(iso639_lang_t language)
- {
- string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name);
- string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name);
- return new Language
- {
- Code = language.iso639_2,
- EnglishName = englishName,
- NativeName = nativeName
- };
- }
-
- /// <summary>
- /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here.
- /// </summary>
- /// <param name="pts">
- /// The PTS to convert.
- /// </param>
- /// <returns>
- /// The timespan for it.
- /// </returns>
- public static TimeSpan PtsToTimeSpan(ulong pts)
- {
- return TimeSpan.FromTicks((long)((pts * 10000000) / 90000));
- }
-
- /// <summary>
- /// Converts the PTS amount to seconds.
- /// </summary>
- /// <param name="pts">
- /// The PTS to convert.
- /// </param>
- /// <returns>
- /// The corresponding number of seconds.
- /// </returns>
- public static double PtsToSeconds(ulong pts)
- {
- return (double)pts / 90000;
- }
- }
+ DefaultQuality = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
+ CompressionLimits = HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec),
+ DefaultCompression =
+ HBFunctions.hb_audio_compression_get_default((uint)encoder.codec)
+ };
+
+ return result;
+ }
+
+ /// <summary>
+ /// Converts a native HB rate structure to an HBRate object.
+ /// </summary>
+ /// <param name="rate">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted rate object.
+ /// </returns>
+ public static HBRate NativeToRate(hb_rate_s rate)
+ {
+ return new HBRate
+ {
+ Name = rate.name,
+ Rate = rate.rate
+ };
+ }
+
+ /// <summary>
+ /// Converts a native HB mixdown structure to a Mixdown model.
+ /// </summary>
+ /// <param name="mixdown">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted model.
+ /// </returns>
+ public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)
+ {
+ return new HBMixdown
+ {
+ Id = mixdown.amixdown,
+ ShortName = mixdown.short_name,
+ DisplayName = mixdown.name
+ };
+ }
+
+ /// <summary>
+ /// Converts a native HB container structure into an HBContainer object.
+ /// </summary>
+ /// <param name="container">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted structure.
+ /// </returns>
+ public static HBContainer NativeToContainer(hb_container_s container)
+ {
+ return new HBContainer
+ {
+ DisplayName = container.name,
+ ShortName = container.short_name,
+ DefaultExtension = container.default_extension,
+ Id = container.format
+ };
+ }
+
+ /// <summary>
+ /// Converts a native language structure to a Language object.
+ /// </summary>
+ /// <param name="language">
+ /// The structure to convert.
+ /// </param>
+ /// <returns>
+ /// The converted structure.
+ /// </returns>
+ public static Language NativeToLanguage(iso639_lang_t language)
+ {
+ string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name);
+ string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name);
+ return new Language
+ {
+ Code = language.iso639_2,
+ EnglishName = englishName,
+ NativeName = nativeName
+ };
+ }
+
+ /// <summary>
+ /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here.
+ /// </summary>
+ /// <param name="pts">
+ /// The PTS to convert.
+ /// </param>
+ /// <returns>
+ /// The timespan for it.
+ /// </returns>
+ public static TimeSpan PtsToTimeSpan(ulong pts)
+ {
+ return TimeSpan.FromTicks((long)((pts * 10000000) / 90000));
+ }
+
+ /// <summary>
+ /// Converts the PTS amount to seconds.
+ /// </summary>
+ /// <param name="pts">
+ /// The PTS to convert.
+ /// </param>
+ /// <returns>
+ /// The corresponding number of seconds.
+ /// </returns>
+ public static double PtsToSeconds(ulong pts)
+ {
+ return (double)pts / 90000;
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
index 2ad727a9e..138eed367 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
@@ -168,7 +168,7 @@ namespace HandBrake.ApplicationServices.Interop
if (!string.IsNullOrEmpty(message))
{
// These errors happen in normal operations. Log them as messages.
- if (message == "dvd: ifoOpen failed" || message.Contains("avformat_seek_file failed") || message.Contains("nav_get_title_list"))
+ if (message == "dvd: ifoOpen failed" || message.Contains("avformat_seek_file failed") || message.Contains("nav_get_title_list"))
{
SendMessageEvent(message);
return;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs
index 283beb88e..3dff02a9d 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs
@@ -10,8 +10,8 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate void LoggingCallback(string message);
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ public delegate void LoggingCallback(string message);
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
index 23f0df750..dab5d1bb3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs
@@ -10,182 +10,182 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System;
- using System.Runtime.InteropServices;
+ using System;
+ using System.Runtime.InteropServices;
- /// <summary>
- /// Contains p-invoke function declarations to hblib.
- /// </summary>
- public static class HBFunctions
- {
- [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_register_logger(LoggingCallback callback);
+ /// <summary>
+ /// Contains p-invoke function declarations to hblib.
+ /// </summary>
+ public static class HBFunctions
+ {
+ [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_register_logger(LoggingCallback callback);
- [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_register_error_handler(LoggingCallback callback);
+ [DllImport("hb.dll", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_register_error_handler(LoggingCallback callback);
- [DllImport("hb.dll", EntryPoint = "hb_global_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_global_init();
+ [DllImport("hb.dll", EntryPoint = "hb_global_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_global_init();
- /// Return Type: hb_handle_t*
- ///verbose: int
- ///update_check: int
- [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_init(int verbose, int update_check);
+ /// Return Type: hb_handle_t*
+ ///verbose: int
+ ///update_check: int
+ [DllImport("hb.dll", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_init(int verbose, int update_check);
- /// Return Type: hb_handle_t*
- ///verbose: int
- ///update_check: int
- [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_init_dl(int verbose, int update_check);
+ /// Return Type: hb_handle_t*
+ ///verbose: int
+ ///update_check: int
+ [DllImport("hb.dll", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_init_dl(int verbose, int update_check);
- /// Return Type: char*
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_get_version(IntPtr hbHandle);
+ /// Return Type: char*
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_get_version(IntPtr hbHandle);
- /// Return Type: int
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_get_build(IntPtr hbHandle);
+ /// Return Type: int
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_get_build(IntPtr hbHandle);
- /// Return Type: int
- ///h: hb_handle_t*
- ///version: char**
- [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_check_update(IntPtr handle, ref IntPtr version);
+ /// Return Type: int
+ ///h: hb_handle_t*
+ ///version: char**
+ [DllImport("hb.dll", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_check_update(IntPtr handle, ref IntPtr version);
- /// Return Type: char*
- ///path: char*
- [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_dvd_name(IntPtr path);
+ /// Return Type: char*
+ ///path: char*
+ [DllImport("hb.dll", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_dvd_name(IntPtr path);
- /// Return Type: void
- ///enable: int
- [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_dvd_set_dvdnav(int enable);
+ /// Return Type: void
+ ///enable: int
+ [DllImport("hb.dll", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_dvd_set_dvdnav(int enable);
- /// Return Type: void
- ///param0: hb_handle_t*
- ///path: char*
- ///title_index: int
- ///preview_count: int
- ///store_previews: int
- [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ ///path: char*
+ ///title_index: int
+ ///preview_count: int
+ ///store_previews: int
+ [DllImport("hb.dll", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration);
- [DllImport("hb.dll", EntryPoint = "hb_scan_stop", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_scan_stop(IntPtr hbHandle);
+ [DllImport("hb.dll", EntryPoint = "hb_scan_stop", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_scan_stop(IntPtr hbHandle);
- /// Return Type: hb_list_t*
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_get_titles(IntPtr hbHandle);
+ /// Return Type: hb_list_t*
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_get_titles(IntPtr hbHandle);
[DllImport("hb.dll", EntryPoint = "hb_set_anamorphic_size2", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result);
- /// Return Type: int
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_count(IntPtr hbHandle);
+ /// Return Type: int
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_count(IntPtr hbHandle);
- /// Return Type: hb_job_t*
- ///param0: hb_handle_t*
- ///param1: int
- [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);
+ /// Return Type: hb_job_t*
+ ///param0: hb_handle_t*
+ ///param1: int
+ [DllImport("hb.dll", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex);
- /// Return Type: void
- ///param0: hb_handle_t*
- ///param1: hb_job_t*
- [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_rem(IntPtr hbHandle, IntPtr job);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ ///param1: hb_job_t*
+ [DllImport("hb.dll", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_rem(IntPtr hbHandle, IntPtr job);
- /// Return Type: void
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_start(IntPtr hbHandle);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_start(IntPtr hbHandle);
- /// Return Type: void
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_pause(IntPtr hbHandle);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_pause(IntPtr hbHandle);
- /// Return Type: void
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_resume(IntPtr hbHandle);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_resume(IntPtr hbHandle);
- /// Return Type: void
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_stop(IntPtr hbHandle);
+ /// Return Type: void
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_stop(IntPtr hbHandle);
- /// Return Type: int
- ///param0: hb_handle_t*
- [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_get_scancount(IntPtr hbHandle);
+ /// Return Type: int
+ ///param0: hb_handle_t*
+ [DllImport("hb.dll", EntryPoint = "hb_get_scancount", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_get_scancount(IntPtr hbHandle);
- /// Return Type: void
- ///param0: hb_handle_t**
- [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_close(IntPtr hbHandle);
+ /// Return Type: void
+ ///param0: hb_handle_t**
+ [DllImport("hb.dll", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_close(IntPtr hbHandle);
- [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_global_close();
+ [DllImport("hb.dll", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_global_close();
- //hb_list_t * hb_list_init();
- [DllImport("hb.dll", EntryPoint = "hb_list_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_list_init();
+ //hb_list_t * hb_list_init();
+ [DllImport("hb.dll", EntryPoint = "hb_list_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_list_init();
- //int hb_list_count( const hb_list_t * );
- [DllImport("hb.dll", EntryPoint = "hb_list_count", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_list_count(IntPtr listPtr);
+ //int hb_list_count( const hb_list_t * );
+ [DllImport("hb.dll", EntryPoint = "hb_list_count", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_list_count(IntPtr listPtr);
- //void hb_list_add( hb_list_t *, void * );
- [DllImport("hb.dll", EntryPoint = "hb_list_add", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_list_add(IntPtr listPtr, IntPtr item);
+ //void hb_list_add( hb_list_t *, void * );
+ [DllImport("hb.dll", EntryPoint = "hb_list_add", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_list_add(IntPtr listPtr, IntPtr item);
- //void hb_list_insert( hb_list_t * l, int pos, void * p );
- [DllImport("hb.dll", EntryPoint = "hb_list_insert", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_list_insert(IntPtr listPtr, int pos, IntPtr item);
+ //void hb_list_insert( hb_list_t * l, int pos, void * p );
+ [DllImport("hb.dll", EntryPoint = "hb_list_insert", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_list_insert(IntPtr listPtr, int pos, IntPtr item);
- //void hb_list_rem( hb_list_t *, void * );
- [DllImport("hb.dll", EntryPoint = "hb_list_rem", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_list_rem(IntPtr listPtr, IntPtr item);
+ //void hb_list_rem( hb_list_t *, void * );
+ [DllImport("hb.dll", EntryPoint = "hb_list_rem", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_list_rem(IntPtr listPtr, IntPtr item);
- //void * hb_list_item( const hb_list_t *, int );
- [DllImport("hb.dll", EntryPoint = "hb_list_item", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_list_item(IntPtr listPtr, int itemIndex);
+ //void * hb_list_item( const hb_list_t *, int );
+ [DllImport("hb.dll", EntryPoint = "hb_list_item", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_list_item(IntPtr listPtr, int itemIndex);
- //void hb_list_close( hb_list_t ** );
- [DllImport("hb.dll", EntryPoint = "hb_list_close", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_list_close(IntPtr listPtrPtr);
+ //void hb_list_close( hb_list_t ** );
+ [DllImport("hb.dll", EntryPoint = "hb_list_close", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_list_close(IntPtr listPtrPtr);
- [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_force", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_subtitle_can_force(int source);
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_force", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_force(int source);
- [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_burn", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_subtitle_can_burn(int source);
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_burn", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_burn(int source);
- [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_pass", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_subtitle_can_pass(int source, int mux);
+ [DllImport("hb.dll", EntryPoint = "hb_subtitle_can_pass", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_subtitle_can_pass(int source, int mux);
// int hb_video_framerate_get_from_name(const char *name)
@@ -195,54 +195,54 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
//const char* hb_video_framerate_get_name(int framerate);
//const char* hb_video_framerate_sanitize_name(const char *name);
- // returns hb_rate_s
- [DllImport("hb.dll", EntryPoint = "hb_video_framerate_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_framerate_get_next(IntPtr last);
+ // returns hb_rate_s
+ [DllImport("hb.dll", EntryPoint = "hb_video_framerate_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_framerate_get_next(IntPtr last);
//int hb_audio_samplerate_get_best(uint32_t codec, int samplerate, int *sr_shift);
//int hb_audio_samplerate_get_from_name(const char *name);
//const char* hb_audio_samplerate_get_name(int samplerate);
- // returns hb_rate_s
- [DllImport("hb.dll", EntryPoint = "hb_audio_samplerate_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_audio_samplerate_get_next(IntPtr last);
+ // returns hb_rate_s
+ [DllImport("hb.dll", EntryPoint = "hb_audio_samplerate_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_audio_samplerate_get_next(IntPtr last);
- [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_best", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_best", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown);
- [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_default", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_default", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown);
- [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_limits", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_limits", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high);
- [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last);
- [DllImport("hb.dll", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
+ [DllImport("hb.dll", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
- [DllImport("hb.dll", EntryPoint = "hb_video_quality_get_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_quality_get_name(uint codec);
+ [DllImport("hb.dll", EntryPoint = "hb_video_quality_get_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_quality_get_name(uint codec);
- [DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
//float hb_audio_quality_get_best(uint32_t codec, float quality);
- [DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_default", CallingConvention = CallingConvention.Cdecl)]
- public static extern float hb_audio_quality_get_default(uint codec);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_quality_get_default", CallingConvention = CallingConvention.Cdecl)]
+ public static extern float hb_audio_quality_get_default(uint codec);
- [DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_limits", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_limits", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
//float hb_audio_compression_get_best(uint32_t codec, float compression);
- [DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_default", CallingConvention = CallingConvention.Cdecl)]
- public static extern float hb_audio_compression_get_default(uint codec);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_compression_get_default", CallingConvention = CallingConvention.Cdecl)]
+ public static extern float hb_audio_compression_get_default(uint codec);
//int hb_audio_dither_get_default();
@@ -256,31 +256,31 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
[DllImport("hb.dll", EntryPoint = "hb_audio_can_apply_drc2", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_can_apply_drc2(IntPtr handle, int title_index, int audio_index, int encoder);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout);
//int hb_mixdown_get_discrete_channel_count(int mixdown);
//int hb_mixdown_get_low_freq_channel_count(int mixdown);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_best", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_mixdown_get_best(uint codec, ulong layout, int mixdown);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_best", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_get_best(uint codec, ulong layout, int mixdown);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_default", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_mixdown_get_default(uint codec, ulong layout);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_default", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_mixdown_get_default(uint codec, ulong layout);
//int hb_mixdown_get_from_name(const char *name);
//const char* hb_mixdown_get_name(int mixdown);
//const char* hb_mixdown_get_short_name(int mixdown);
//const char* hb_mixdown_sanitize_name(const char *name);
- [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_mixdown_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "hb_mixdown_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_mixdown_get_next(IntPtr last);
//int hb_video_encoder_get_default(int muxer);
//int hb_video_encoder_get_from_name(const char *name);
@@ -289,8 +289,8 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
//const char* hb_video_encoder_get_long_name(int encoder);
//const char* hb_video_encoder_sanitize_name(const char *name);
- [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_encoder_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_encoder_get_next(IntPtr last);
/*
* hb_audio_encoder_get_fallback_for_passthru() will sanitize a passthru codec
@@ -307,8 +307,8 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
//const char* hb_audio_encoder_get_long_name(int encoder);
//const char* hb_audio_encoder_sanitize_name(const char *name);
- [DllImport("hb.dll", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_audio_encoder_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_audio_encoder_get_next(IntPtr last);
//int hb_container_get_from_name(const char *name);
//int hb_container_get_from_extension(const char *extension); // not really a container name
@@ -318,87 +318,87 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
//const char* hb_container_get_default_extension(int format);
//const char* hb_container_sanitize_name(const char *name);
- [DllImport("hb.dll", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name);
+ [DllImport("hb.dll", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name);
- [DllImport("hb.dll", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_container_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_container_get_next(IntPtr last);
- [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_presets", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_encoder_get_presets(int encoder);
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_presets", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_encoder_get_presets(int encoder);
- [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_tunes", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_encoder_get_tunes(int encoder);
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_tunes", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_encoder_get_tunes(int encoder);
- [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_profiles", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_encoder_get_profiles(int encoder);
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_profiles", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_encoder_get_profiles(int encoder);
- [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_levels", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_video_encoder_get_levels(int encoder);
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_levels", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_video_encoder_get_levels(int encoder);
- [DllImport("hb.dll", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr lang_get_next(IntPtr last);
+ [DllImport("hb.dll", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr lang_get_next(IntPtr last);
- [DllImport("hb.dll", EntryPoint = "lang_for_code2", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2);
+ [DllImport("hb.dll", EntryPoint = "lang_for_code2", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2);
- ///hb_title_set_t * hb_get_title_set( hb_handle_t * );
- [DllImport("hb.dll", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_get_title_set(IntPtr hbHandle);
+ ///hb_title_set_t * hb_get_title_set( hb_handle_t * );
+ [DllImport("hb.dll", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_get_title_set(IntPtr hbHandle);
- ///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index );
- [DllImport("hb.dll", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index);
+ ///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index );
+ [DllImport("hb.dll", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index);
- ///void hb_job_close( hb_job_t ** job );
- [DllImport("hb.dll", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_job_close(IntPtr job);
+ ///void hb_job_close( hb_job_t ** job );
+ [DllImport("hb.dll", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_job_close(IntPtr job);
- ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
- [DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title);
+ ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
+ [DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title);
- ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
- [DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
- public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title);
+ ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title);
+ [DllImport("hb.dll", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)]
+ public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title);
- /// hb_filter_object_t * hb_filter_init( int filter_id );
- [DllImport("hb.dll", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_filter_init(int filter_id);
+ /// hb_filter_object_t * hb_filter_init( int filter_id );
+ [DllImport("hb.dll", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_filter_init(int filter_id);
- [DllImport("hb.dll", EntryPoint = "hb_generate_filter_settings", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_generate_filter_settings(
- int filter_id,
- [In] [MarshalAs(UnmanagedType.LPStr)] string preset,
- [In] [MarshalAs(UnmanagedType.LPStr)] string tune);
+ [DllImport("hb.dll", EntryPoint = "hb_generate_filter_settings", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_generate_filter_settings(
+ int filter_id,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string preset,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string tune);
- [DllImport("hb.dll", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_x264_encopt_name(IntPtr name);
+ [DllImport("hb.dll", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_x264_encopt_name(IntPtr name);
- [DllImport("hb.dll", EntryPoint = "hb_check_h264_level", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced);
+ [DllImport("hb.dll", EntryPoint = "hb_check_h264_level", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced);
- [DllImport("hb.dll", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr hb_x264_param_unparse(
- [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset,
- [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune,
- [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts,
- [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile,
- [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level,
- int width,
- int height);
+ [DllImport("hb.dll", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr hb_x264_param_unparse(
+ [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile,
+ [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level,
+ int width,
+ int height);
- [DllImport("hb.dll", EntryPoint = "hb_get_opencl_env", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_get_opencl_env();
+ [DllImport("hb.dll", EntryPoint = "hb_get_opencl_env", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_get_opencl_env();
- [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_qsv_available();
-
- [DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)]
- public static extern int hb_qsv_info_init();
+ [DllImport("hb.dll", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_qsv_available();
+
+ [DllImport("hb.dll", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)]
+ public static extern int hb_qsv_info_init();
// hb_image_t* hb_get_preview2(hb_handle_t* h, int title_idx, int picture, hb_geometry_settings_t* geo, int deinterlace);
[DllImport("hb.dll", EntryPoint = "hb_get_preview2", CallingConvention = CallingConvention.Cdecl)]
@@ -438,5 +438,5 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
// char* hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, hb_geometry_settings_t *settings)
[DllImport("hb.dll", EntryPoint = "hb_get_preview_params_json", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, ref hb_geometry_settings_s settings);
- }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
index e4500c864..6e4b3038a 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs
@@ -10,43 +10,43 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- public class NativeConstants
- {
- // Audio encoders
- public const uint HB_ACODEC_MASK = 0x00FFFF00;
- public const uint HB_ACODEC_LAME = 0x00000200;
- public const uint HB_ACODEC_VORBIS = 0x00000400;
- public const uint HB_ACODEC_AC3 = 0x00000800;
- public const uint HB_ACODEC_LPCM = 0x00001000;
- public const uint HB_ACODEC_DCA = 0x00002000;
- public const uint HB_ACODEC_CA_AAC = 0x00004000;
- public const uint HB_ACODEC_CA_HAAC = 0x00008000;
- public const uint HB_ACODEC_FFAAC = 0x00010000;
- public const uint HB_ACODEC_FFMPEG = 0x00020000;
- public const uint HB_ACODEC_DCA_HD = 0x00040000;
- public const uint HB_ACODEC_MP3 = 0x00080000;
- public const uint HB_ACODEC_FFFLAC = 0x00100000;
- public const uint HB_ACODEC_FFFLAC24 = 0x00200000;
- public const uint HB_ACODEC_FDK_AAC = 0x00400000;
- public const uint HB_ACODEC_FDK_HAAC = 0x00800000;
- public const uint HB_ACODEC_FF_MASK = 0x00FF2800;
- public const uint HB_ACODEC_PASS_FLAG = 0x40000000;
- public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_MP3 | HB_ACODEC_FFAAC | HB_ACODEC_DCA_HD | HB_ACODEC_AC3 | HB_ACODEC_DCA);
- public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG);
- public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG);
+ public class NativeConstants
+ {
+ // Audio encoders
+ public const uint HB_ACODEC_MASK = 0x00FFFF00;
+ public const uint HB_ACODEC_LAME = 0x00000200;
+ public const uint HB_ACODEC_VORBIS = 0x00000400;
+ public const uint HB_ACODEC_AC3 = 0x00000800;
+ public const uint HB_ACODEC_LPCM = 0x00001000;
+ public const uint HB_ACODEC_DCA = 0x00002000;
+ public const uint HB_ACODEC_CA_AAC = 0x00004000;
+ public const uint HB_ACODEC_CA_HAAC = 0x00008000;
+ public const uint HB_ACODEC_FFAAC = 0x00010000;
+ public const uint HB_ACODEC_FFMPEG = 0x00020000;
+ public const uint HB_ACODEC_DCA_HD = 0x00040000;
+ public const uint HB_ACODEC_MP3 = 0x00080000;
+ public const uint HB_ACODEC_FFFLAC = 0x00100000;
+ public const uint HB_ACODEC_FFFLAC24 = 0x00200000;
+ public const uint HB_ACODEC_FDK_AAC = 0x00400000;
+ public const uint HB_ACODEC_FDK_HAAC = 0x00800000;
+ public const uint HB_ACODEC_FF_MASK = 0x00FF2800;
+ public const uint HB_ACODEC_PASS_FLAG = 0x40000000;
+ public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_MP3 | HB_ACODEC_FFAAC | HB_ACODEC_DCA_HD | HB_ACODEC_AC3 | HB_ACODEC_DCA);
+ public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG);
+ public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG);
- // Encode state
- public const int HB_STATE_IDLE = 1;
- public const int HB_STATE_SCANNING = 2;
- public const int HB_STATE_SCANDONE = 4;
- public const int HB_STATE_WORKING = 8;
- public const int HB_STATE_PAUSED = 16;
- public const int HB_STATE_WORKDONE = 32;
- public const int HB_STATE_MUXING = 64;
- }
+ // Encode state
+ public const int HB_STATE_IDLE = 1;
+ public const int HB_STATE_SCANNING = 2;
+ public const int HB_STATE_SCANDONE = 4;
+ public const int HB_STATE_WORKING = 8;
+ public const int HB_STATE_PAUSED = 16;
+ public const int HB_STATE_WORKDONE = 32;
+ public const int HB_STATE_MUXING = 64;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs
index b332f25eb..b9a8f3255 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs
@@ -7,23 +7,23 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential)]
+ [StructLayout(LayoutKind.Sequential)]
public struct hb_container_s
- {
- [MarshalAs(UnmanagedType.LPStr)]
- public string name;
+ {
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string short_name;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string short_name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string long_name;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string long_name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string default_extension;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string default_extension;
- public int format;
- }
+ public int format;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs
index a4ac0f8e9..9491cb160 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs
@@ -7,22 +7,22 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential)]
+ [StructLayout(LayoutKind.Sequential)]
public struct hb_encoder_s
- {
- [MarshalAs(UnmanagedType.LPStr)]
- public string name;
+ {
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string short_name;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string short_name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string long_name;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string long_name;
- public int codec;
+ public int codec;
- public int muxers;
- }
+ public int muxers;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs
index ac8a91592..e9f2b3524 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs
@@ -13,11 +13,11 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
/// The hb_error_code.
/// </summary>
internal enum hb_error_code
- {
- HB_ERROR_NONE = 0,
- HB_ERROR_CANCELED,
- HB_ERROR_WRONG_INPUT,
- HB_ERROR_INIT,
- HB_ERROR_UNKNOWN
- }
+ {
+ HB_ERROR_NONE = 0,
+ HB_ERROR_CANCELED,
+ HB_ERROR_WRONG_INPUT,
+ HB_ERROR_INIT,
+ HB_ERROR_UNKNOWN
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs
index 67803b5b2..4ae61ad65 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs
@@ -8,23 +8,23 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
internal enum hb_filter_ids
- {
- HB_FILTER_QSV_PRE = 1, // for QSV - important to have before other filters
- // First, filters that may change the framerate (drop or dup frames)
- HB_FILTER_DETELECINE,
- HB_FILTER_DECOMB,
- HB_FILTER_DEINTERLACE,
- HB_FILTER_VFR,
- // Filters that must operate on the original source image are next
- HB_FILTER_DEBLOCK,
- HB_FILTER_HQDN3D,
- HB_FILTER_NLMEANS,
- HB_FILTER_RENDER_SUB,
- HB_FILTER_CROP_SCALE,
- // Finally filters that don't care what order they are in,
- // except that they must be after the above filters
- HB_FILTER_ROTATE,
- HB_FILTER_QSV_POST, // for QSV - important to have as a last one
- HB_FILTER_QSV, // default MSDK VPP filter
- }
+ {
+ HB_FILTER_QSV_PRE = 1, // for QSV - important to have before other filters
+ // First, filters that may change the framerate (drop or dup frames)
+ HB_FILTER_DETELECINE,
+ HB_FILTER_DECOMB,
+ HB_FILTER_DEINTERLACE,
+ HB_FILTER_VFR,
+ // Filters that must operate on the original source image are next
+ HB_FILTER_DEBLOCK,
+ HB_FILTER_HQDN3D,
+ HB_FILTER_NLMEANS,
+ HB_FILTER_RENDER_SUB,
+ HB_FILTER_CROP_SCALE,
+ // Finally filters that don't care what order they are in,
+ // except that they must be after the above filters
+ HB_FILTER_ROTATE,
+ HB_FILTER_QSV_POST, // for QSV - important to have as a last one
+ HB_FILTER_QSV, // default MSDK VPP filter
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs
index 3d6654daf..768ec3189 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs
@@ -7,19 +7,19 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential)]
- public struct hb_mixdown_s
- {
- [MarshalAs(UnmanagedType.LPStr)]
- public string name;
+ [StructLayout(LayoutKind.Sequential)]
+ public struct hb_mixdown_s
+ {
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string name;
- /// char*
- [MarshalAs(UnmanagedType.LPStr)]
- public string short_name;
+ /// char*
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string short_name;
- /// int
- public int amixdown;
- }
+ /// int
+ public int amixdown;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs
index 9c365eac9..bebeccb7f 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs
@@ -7,16 +7,16 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System.Runtime.InteropServices;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential)]
- public struct hb_rate_s
- {
- /// char*
- [MarshalAs(UnmanagedType.LPStr)]
- public string name;
+ [StructLayout(LayoutKind.Sequential)]
+ public struct hb_rate_s
+ {
+ /// char*
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string name;
- /// int
- public int rate;
- }
+ /// int
+ public int rate;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs
index ac2a7e80b..4d0351814 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs
@@ -7,22 +7,22 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- public enum hb_subtitle_s_subsource
- {
- VOBSUB,
+ public enum hb_subtitle_s_subsource
+ {
+ VOBSUB,
- SRTSUB,
+ SRTSUB,
- CC608SUB,
+ CC608SUB,
- CC708SUB,
+ CC708SUB,
- UTF8SUB,
+ UTF8SUB,
- TX3GSUB,
+ TX3GSUB,
- SSASUB,
+ SSASUB,
- PGSSUB
- }
+ PGSSUB
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs
index e99b79c9a..1a4780ab2 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs
@@ -7,23 +7,23 @@
namespace HandBrake.ApplicationServices.Interop.HbLib
{
- using System;
- using System.Runtime.InteropServices;
+ using System;
+ using System.Runtime.InteropServices;
- [StructLayout(LayoutKind.Sequential)]
- public struct iso639_lang_t
- {
- public IntPtr eng_name;
+ [StructLayout(LayoutKind.Sequential)]
+ public struct iso639_lang_t
+ {
+ public IntPtr eng_name;
- public IntPtr native_name;
+ public IntPtr native_name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string iso639_1;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string iso639_1;
- [MarshalAs(UnmanagedType.LPStr)]
- public string iso639_2;
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string iso639_2;
- [MarshalAs(UnmanagedType.LPStr)]
- public string iso639_2b;
- }
+ [MarshalAs(UnmanagedType.LPStr)]
+ public string iso639_2b;
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs
index ad8f35762..2b62de4d8 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs
@@ -18,266 +18,266 @@ namespace HandBrake.ApplicationServices.Interop.Helpers
using HandBrake.ApplicationServices.Interop.HbLib;
/// <summary>
- /// Helper utilities for native interop.
- /// </summary>
- internal static class InteropUtilities
- {
- /// <summary>
- /// Reads the given native structure pointer.
- /// </summary>
- /// <typeparam name="T">The type to convert the structure to.</typeparam>
- /// <param name="structPtr">The pointer to the native structure.</param>
- /// <returns>The converted structure.</returns>
- public static T ToStructureFromPtr<T>(IntPtr structPtr)
- {
- return (T)Marshal.PtrToStructure(structPtr, typeof(T));
- }
-
- /// <summary>
- /// Reads the given native UTF-8 string.
- /// </summary>
- /// <param name="stringPtr">The pointer to the string.</param>
- /// <returns>The resulting string.</returns>
- public static string ToStringFromUtf8Ptr(IntPtr stringPtr)
- {
- var data = new List<byte>();
- var ptr = stringPtr;
- var offset = 0;
- while (true)
- {
- byte ch = Marshal.ReadByte(ptr, offset++);
- if (ch == 0)
- {
- break;
- }
-
- data.Add(ch);
- }
-
- return Encoding.UTF8.GetString(data.ToArray());
- }
-
- /// <summary>
- /// Creates a pointer to a UTF-8 null-terminated string.
- /// </summary>
- /// <param name="str">
- /// The string to encode.
- /// </param>
- /// <returns>
- /// The <see cref="IntPtr"/>.
- /// </returns>
- public static IntPtr ToUtf8PtrFromString(string str)
- {
- byte[] bytes = Encoding.UTF8.GetBytes(str);
- IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1);
- var offset = 0;
- foreach (byte b in bytes)
- {
- Marshal.WriteByte(stringPtr, offset, b);
- offset++;
- }
-
- Marshal.WriteByte(stringPtr, offset, 0);
- return stringPtr;
- }
-
- /// <summary>
- /// Converts the given native HandBrake list to a managed list.
- /// </summary>
- /// <typeparam name="T">The type of structure in the list.</typeparam>
- /// <param name="listPtr">The pointer to the native list.</param>
- /// <returns>The converted managed list.</returns>
- public static List<T> ToListFromHandBrakeList<T>(this IntPtr listPtr)
- {
- List<T> returnList = new List<T>();
- NativeList nativeList = new NativeList(listPtr);
-
- for (int i = 0; i < nativeList.Count; i++)
- {
- IntPtr itemPtr = nativeList[i];
- returnList.Add(ToStructureFromPtr<T>(itemPtr));
- }
-
- return returnList;
- }
-
- /// <summary>
- /// Converts the HB list to a managed list of pointers.
- /// </summary>
- /// <param name="listPtr">The list to convert.</param>
- /// <returns>The managed list of pointers.</returns>
- public static List<IntPtr> ToIntPtrList(this IntPtr listPtr)
- {
- var returnList = new List<IntPtr>();
- NativeList nativeList = new NativeList(listPtr);
-
- for (int i = 0; i < nativeList.Count; i++)
- {
- IntPtr itemPtr = nativeList[i];
- returnList.Add(itemPtr);
- }
-
- return returnList;
- }
-
- /// <summary>
- /// Converts the given native array to a managed collection.
- /// </summary>
- /// <typeparam name="T">The type of item in the list.</typeparam>
- /// <param name="arrayPtr">The pointer to the array.</param>
- /// <param name="count">The number of items in the array.</param>
- /// <returns>The converted collection.</returns>
- public static List<T> ToListFromNativeArray<T>(IntPtr arrayPtr, int count)
- {
- IntPtr currentItem = arrayPtr;
-
- var result = new List<T>();
- for (int i = 0; i < count; i++)
- {
- T nativeEncoder = ToStructureFromPtr<T>(currentItem);
- result.Add(nativeEncoder);
-
- currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T)));
- }
-
- return result;
- }
-
- /// <summary>
- /// Takes an array pointer and converts it into a list of strings.
- /// </summary>
- /// <param name="arrayPtr">A pointer to a raw list of strings.</param>
- /// <returns>The list of strings.</returns>
- public static List<string> ToStringListFromArrayPtr(IntPtr arrayPtr)
- {
- if (arrayPtr == IntPtr.Zero)
- {
- return null;
- }
-
- return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList();
- }
-
- /// <summary>
- /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer.
- /// </summary>
- /// <param name="arrayPtr">The address of the list of pointers.</param>
- /// <returns>The list of pointers.</returns>
- public static List<IntPtr> ToPtrListFromPtr(IntPtr arrayPtr)
- {
- var result = new List<IntPtr>();
- int ptrSize = Marshal.SizeOf(typeof(IntPtr));
- IntPtr currentPtr = Marshal.ReadIntPtr(arrayPtr);
- for (int i = 0; currentPtr != IntPtr.Zero; i++)
- {
- result.Add(currentPtr);
- currentPtr = Marshal.ReadIntPtr(arrayPtr, (i + 1) * ptrSize);
- }
-
- return result;
- }
-
- /// <summary>
- /// Creates a native HandBrake list from the given managed list of pointers.
- /// </summary>
- /// <param name="list">The managed list to convert.</param>
- /// <returns>The converted native list.</returns>
- public static NativeList ToHandBrakeListFromPtrList(List<IntPtr> list)
- {
- NativeList returnList = NativeList.CreateList();
-
- foreach (IntPtr ptr in list)
- {
- returnList.Add(ptr);
- }
-
- return returnList;
- }
-
- /// <summary>
- /// Creates a native HandBrake list from the given managed list of structures.
- /// </summary>
- /// <typeparam name="T">The type of structures in the list.</typeparam>
- /// <param name="list">The managed list to convert.</param>
- /// <returns>The converted native list.</returns>
- public static NativeList ToHandBrakeListFromList<T>(List<T> list)
- {
- NativeList returnList = NativeList.CreateList();
- foreach (T item in list)
- {
- IntPtr itemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T)));
- returnList.AllocatedMemory.Add(itemPtr);
- Marshal.StructureToPtr(item, itemPtr, false);
-
- returnList.Add(itemPtr);
- }
-
- return returnList;
- }
-
- /// <summary>
- /// Reads in a list of objects given an interator and a conversion function.
- /// </summary>
- /// <typeparam name="T1">The type of the struct given by the iterator.</typeparam>
- /// <typeparam name="T2">The object type to convert to.</typeparam>
- /// <param name="iterator">The iterator to use to build the list.</param>
- /// <param name="converter">The converter to convert from the struct to the object.</param>
- /// <returns>The list of objects.</returns>
- public static List<T2> ToListFromIterator<T1, T2>(Func<IntPtr, IntPtr> iterator, Func<T1, T2> converter)
- {
- return ToListFromIterator<T1>(iterator).Select(converter).ToList();
- }
-
- /// <summary>
- /// Reads in a list of structs given an iterator.
- /// </summary>
- /// <typeparam name="T">The type of the struct.</typeparam>
- /// <param name="iterator">The iterator to use to build the list.</param>
- /// <returns>The list of structs.</returns>
- public static List<T> ToListFromIterator<T>(Func<IntPtr, IntPtr> iterator)
- {
- var structureList = new List<T>();
- IntPtr current = IntPtr.Zero;
-
- current = iterator(current);
- while (current != IntPtr.Zero)
- {
- T encoder = ToStructureFromPtr<T>(current);
- structureList.Add(encoder);
-
- current = iterator(current);
- }
-
- return structureList;
- }
-
- /// <summary>
- /// Closes the given job.
- /// </summary>
- /// <param name="nativeJobPtr">The pointer to the job.</param>
- public static void CloseJob(IntPtr nativeJobPtr)
- {
- // Create a point to the job pointer first.
- IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
-
- // Assign the new pointer to the job pointer and tell HB to clean the job up.
- Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr);
- HBFunctions.hb_job_close(nativeJobPtrPtr);
-
- // Free the pointer we used.
- Marshal.FreeHGlobal(nativeJobPtrPtr);
- }
-
- /// <summary>
- /// Frees all the memory locations in the given list.
- /// </summary>
- /// <param name="memoryList">The list of memory locations to free.</param>
- public static void FreeMemory(List<IntPtr> memoryList)
- {
- foreach (IntPtr memoryLocation in memoryList)
- {
- Marshal.FreeHGlobal(memoryLocation);
- }
- }
- }
+ /// Helper utilities for native interop.
+ /// </summary>
+ internal static class InteropUtilities
+ {
+ /// <summary>
+ /// Reads the given native structure pointer.
+ /// </summary>
+ /// <typeparam name="T">The type to convert the structure to.</typeparam>
+ /// <param name="structPtr">The pointer to the native structure.</param>
+ /// <returns>The converted structure.</returns>
+ public static T ToStructureFromPtr<T>(IntPtr structPtr)
+ {
+ return (T)Marshal.PtrToStructure(structPtr, typeof(T));
+ }
+
+ /// <summary>
+ /// Reads the given native UTF-8 string.
+ /// </summary>
+ /// <param name="stringPtr">The pointer to the string.</param>
+ /// <returns>The resulting string.</returns>
+ public static string ToStringFromUtf8Ptr(IntPtr stringPtr)
+ {
+ var data = new List<byte>();
+ var ptr = stringPtr;
+ var offset = 0;
+ while (true)
+ {
+ byte ch = Marshal.ReadByte(ptr, offset++);
+ if (ch == 0)
+ {
+ break;
+ }
+
+ data.Add(ch);
+ }
+
+ return Encoding.UTF8.GetString(data.ToArray());
+ }
+
+ /// <summary>
+ /// Creates a pointer to a UTF-8 null-terminated string.
+ /// </summary>
+ /// <param name="str">
+ /// The string to encode.
+ /// </param>
+ /// <returns>
+ /// The <see cref="IntPtr"/>.
+ /// </returns>
+ public static IntPtr ToUtf8PtrFromString(string str)
+ {
+ byte[] bytes = Encoding.UTF8.GetBytes(str);
+ IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1);
+ var offset = 0;
+ foreach (byte b in bytes)
+ {
+ Marshal.WriteByte(stringPtr, offset, b);
+ offset++;
+ }
+
+ Marshal.WriteByte(stringPtr, offset, 0);
+ return stringPtr;
+ }
+
+ /// <summary>
+ /// Converts the given native HandBrake list to a managed list.
+ /// </summary>
+ /// <typeparam name="T">The type of structure in the list.</typeparam>
+ /// <param name="listPtr">The pointer to the native list.</param>
+ /// <returns>The converted managed list.</returns>
+ public static List<T> ToListFromHandBrakeList<T>(this IntPtr listPtr)
+ {
+ List<T> returnList = new List<T>();
+ NativeList nativeList = new NativeList(listPtr);
+
+ for (int i = 0; i < nativeList.Count; i++)
+ {
+ IntPtr itemPtr = nativeList[i];
+ returnList.Add(ToStructureFromPtr<T>(itemPtr));
+ }
+
+ return returnList;
+ }
+
+ /// <summary>
+ /// Converts the HB list to a managed list of pointers.
+ /// </summary>
+ /// <param name="listPtr">The list to convert.</param>
+ /// <returns>The managed list of pointers.</returns>
+ public static List<IntPtr> ToIntPtrList(this IntPtr listPtr)
+ {
+ var returnList = new List<IntPtr>();
+ NativeList nativeList = new NativeList(listPtr);
+
+ for (int i = 0; i < nativeList.Count; i++)
+ {
+ IntPtr itemPtr = nativeList[i];
+ returnList.Add(itemPtr);
+ }
+
+ return returnList;
+ }
+
+ /// <summary>
+ /// Converts the given native array to a managed collection.
+ /// </summary>
+ /// <typeparam name="T">The type of item in the list.</typeparam>
+ /// <param name="arrayPtr">The pointer to the array.</param>
+ /// <param name="count">The number of items in the array.</param>
+ /// <returns>The converted collection.</returns>
+ public static List<T> ToListFromNativeArray<T>(IntPtr arrayPtr, int count)
+ {
+ IntPtr currentItem = arrayPtr;
+
+ var result = new List<T>();
+ for (int i = 0; i < count; i++)
+ {
+ T nativeEncoder = ToStructureFromPtr<T>(currentItem);
+ result.Add(nativeEncoder);
+
+ currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T)));
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Takes an array pointer and converts it into a list of strings.
+ /// </summary>
+ /// <param name="arrayPtr">A pointer to a raw list of strings.</param>
+ /// <returns>The list of strings.</returns>
+ public static List<string> ToStringListFromArrayPtr(IntPtr arrayPtr)
+ {
+ if (arrayPtr == IntPtr.Zero)
+ {
+ return null;
+ }
+
+ return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList();
+ }
+
+ /// <summary>
+ /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer.
+ /// </summary>
+ /// <param name="arrayPtr">The address of the list of pointers.</param>
+ /// <returns>The list of pointers.</returns>
+ public static List<IntPtr> ToPtrListFromPtr(IntPtr arrayPtr)
+ {
+ var result = new List<IntPtr>();
+ int ptrSize = Marshal.SizeOf(typeof(IntPtr));
+ IntPtr currentPtr = Marshal.ReadIntPtr(arrayPtr);
+ for (int i = 0; currentPtr != IntPtr.Zero; i++)
+ {
+ result.Add(currentPtr);
+ currentPtr = Marshal.ReadIntPtr(arrayPtr, (i + 1) * ptrSize);
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// Creates a native HandBrake list from the given managed list of pointers.
+ /// </summary>
+ /// <param name="list">The managed list to convert.</param>
+ /// <returns>The converted native list.</returns>
+ public static NativeList ToHandBrakeListFromPtrList(List<IntPtr> list)
+ {
+ NativeList returnList = NativeList.CreateList();
+
+ foreach (IntPtr ptr in list)
+ {
+ returnList.Add(ptr);
+ }
+
+ return returnList;
+ }
+
+ /// <summary>
+ /// Creates a native HandBrake list from the given managed list of structures.
+ /// </summary>
+ /// <typeparam name="T">The type of structures in the list.</typeparam>
+ /// <param name="list">The managed list to convert.</param>
+ /// <returns>The converted native list.</returns>
+ public static NativeList ToHandBrakeListFromList<T>(List<T> list)
+ {
+ NativeList returnList = NativeList.CreateList();
+ foreach (T item in list)
+ {
+ IntPtr itemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T)));
+ returnList.AllocatedMemory.Add(itemPtr);
+ Marshal.StructureToPtr(item, itemPtr, false);
+
+ returnList.Add(itemPtr);
+ }
+
+ return returnList;
+ }
+
+ /// <summary>
+ /// Reads in a list of objects given an interator and a conversion function.
+ /// </summary>
+ /// <typeparam name="T1">The type of the struct given by the iterator.</typeparam>
+ /// <typeparam name="T2">The object type to convert to.</typeparam>
+ /// <param name="iterator">The iterator to use to build the list.</param>
+ /// <param name="converter">The converter to convert from the struct to the object.</param>
+ /// <returns>The list of objects.</returns>
+ public static List<T2> ToListFromIterator<T1, T2>(Func<IntPtr, IntPtr> iterator, Func<T1, T2> converter)
+ {
+ return ToListFromIterator<T1>(iterator).Select(converter).ToList();
+ }
+
+ /// <summary>
+ /// Reads in a list of structs given an iterator.
+ /// </summary>
+ /// <typeparam name="T">The type of the struct.</typeparam>
+ /// <param name="iterator">The iterator to use to build the list.</param>
+ /// <returns>The list of structs.</returns>
+ public static List<T> ToListFromIterator<T>(Func<IntPtr, IntPtr> iterator)
+ {
+ var structureList = new List<T>();
+ IntPtr current = IntPtr.Zero;
+
+ current = iterator(current);
+ while (current != IntPtr.Zero)
+ {
+ T encoder = ToStructureFromPtr<T>(current);
+ structureList.Add(encoder);
+
+ current = iterator(current);
+ }
+
+ return structureList;
+ }
+
+ /// <summary>
+ /// Closes the given job.
+ /// </summary>
+ /// <param name="nativeJobPtr">The pointer to the job.</param>
+ public static void CloseJob(IntPtr nativeJobPtr)
+ {
+ // Create a point to the job pointer first.
+ IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
+
+ // Assign the new pointer to the job pointer and tell HB to clean the job up.
+ Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr);
+ HBFunctions.hb_job_close(nativeJobPtrPtr);
+
+ // Free the pointer we used.
+ Marshal.FreeHGlobal(nativeJobPtrPtr);
+ }
+
+ /// <summary>
+ /// Frees all the memory locations in the given list.
+ /// </summary>
+ /// <param name="memoryList">The list of memory locations to free.</param>
+ public static void FreeMemory(List<IntPtr> memoryList)
+ {
+ foreach (IntPtr memoryLocation in memoryList)
+ {
+ Marshal.FreeHGlobal(memoryLocation);
+ }
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs
index 0731bd331..a692b6c75 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs
@@ -17,111 +17,111 @@ namespace HandBrake.ApplicationServices.Interop.Helpers
using HandBrake.ApplicationServices.Interop.HbLib;
/// <summary>
- /// Represents a HandBrake style native list.
- /// </summary>
- internal class NativeList : IDisposable
- {
- /// <summary>
- /// Initializes a new instance of the NativeList class.
- /// </summary>
- /// <param name="listPtr">The pointer to use for the list.</param>
- public NativeList(IntPtr listPtr)
- {
- this.Ptr = listPtr;
- }
+ /// Represents a HandBrake style native list.
+ /// </summary>
+ internal class NativeList : IDisposable
+ {
+ /// <summary>
+ /// Initializes a new instance of the NativeList class.
+ /// </summary>
+ /// <param name="listPtr">The pointer to use for the list.</param>
+ public NativeList(IntPtr listPtr)
+ {
+ this.Ptr = listPtr;
+ }
- /// <summary>
- /// The list of native memory locations allocated for this list.
- /// </summary>
- private readonly List<IntPtr> allocatedMemory = new List<IntPtr>();
+ /// <summary>
+ /// The list of native memory locations allocated for this list.
+ /// </summary>
+ private readonly List<IntPtr> allocatedMemory = new List<IntPtr>();
- /// <summary>
- /// Gets the pointer to the native list.
- /// </summary>
- public IntPtr Ptr { get; private set; }
+ /// <summary>
+ /// Gets the pointer to the native list.
+ /// </summary>
+ public IntPtr Ptr { get; private set; }
- /// <summary>
- /// Gets the number of items in the list.
- /// </summary>
- public int Count
- {
- get
+ /// <summary>
+ /// Gets the number of items in the list.
+ /// </summary>
+ public int Count
+ {
+ get
{
Debug.WriteLine("Got a Zero Pointer in the NativeList");
return this.Ptr == IntPtr.Zero ? 0 : HBFunctions.hb_list_count(this.Ptr);
- }
- }
+ }
+ }
- /// <summary>
- /// Gets the list of native memory locations allocated for this list.
- /// </summary>
- public List<IntPtr> AllocatedMemory
- {
- get
- {
- return this.allocatedMemory;
- }
- }
+ /// <summary>
+ /// Gets the list of native memory locations allocated for this list.
+ /// </summary>
+ public List<IntPtr> AllocatedMemory
+ {
+ get
+ {
+ return this.allocatedMemory;
+ }
+ }
- /// <summary>
- /// Adds an item to the end of the list.
- /// </summary>
- /// <param name="item">The item to add.</param>
- public void Add(IntPtr item)
- {
- HBFunctions.hb_list_add(this.Ptr, item);
- }
+ /// <summary>
+ /// Adds an item to the end of the list.
+ /// </summary>
+ /// <param name="item">The item to add.</param>
+ public void Add(IntPtr item)
+ {
+ HBFunctions.hb_list_add(this.Ptr, item);
+ }
- /// <summary>
- /// Inserts an item into the list.
- /// </summary>
- /// <param name="position">The index to insert the item at.</param>
- /// <param name="item">The item to insert.</param>
- public void Insert(int position, IntPtr item)
- {
- HBFunctions.hb_list_insert(this.Ptr, position, item);
- }
+ /// <summary>
+ /// Inserts an item into the list.
+ /// </summary>
+ /// <param name="position">The index to insert the item at.</param>
+ /// <param name="item">The item to insert.</param>
+ public void Insert(int position, IntPtr item)
+ {
+ HBFunctions.hb_list_insert(this.Ptr, position, item);
+ }
- /// <summary>
- /// Removes an item from the list.
- /// </summary>
- /// <param name="item">The item to remove.</param>
- public void Remove(IntPtr item)
- {
- HBFunctions.hb_list_rem(this.Ptr, item);
- }
+ /// <summary>
+ /// Removes an item from the list.
+ /// </summary>
+ /// <param name="item">The item to remove.</param>
+ public void Remove(IntPtr item)
+ {
+ HBFunctions.hb_list_rem(this.Ptr, item);
+ }
- /// <summary>
- /// Gets an item out of the list.
- /// </summary>
- /// <param name="i">Index in the list.</param>
- /// <returns>The item at that index in the list.</returns>
- public IntPtr this[int i]
- {
- get
- {
- return HBFunctions.hb_list_item(this.Ptr, i);
- }
- }
+ /// <summary>
+ /// Gets an item out of the list.
+ /// </summary>
+ /// <param name="i">Index in the list.</param>
+ /// <returns>The item at that index in the list.</returns>
+ public IntPtr this[int i]
+ {
+ get
+ {
+ return HBFunctions.hb_list_item(this.Ptr, i);
+ }
+ }
- /// <summary>
- /// Disposes resources associated with this object.
- /// </summary>
- public void Dispose()
- {
- IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
- Marshal.WriteIntPtr(listPtrPtr, this.Ptr);
- HBFunctions.hb_list_close(listPtrPtr);
- Marshal.FreeHGlobal(listPtrPtr);
- }
+ /// <summary>
+ /// Disposes resources associated with this object.
+ /// </summary>
+ public void Dispose()
+ {
+ IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
+ Marshal.WriteIntPtr(listPtrPtr, this.Ptr);
+ HBFunctions.hb_list_close(listPtrPtr);
+ Marshal.FreeHGlobal(listPtrPtr);
+ }
- /// <summary>
- /// Creates a new list in unmanaged memory.
- /// </summary>
- /// <returns>The created list.</returns>
- public static NativeList CreateList()
- {
- return new NativeList(HBFunctions.hb_list_init());
- }
- }
+ /// <summary>
+ /// Creates a new list in unmanaged memory.
+ /// </summary>
+ /// <returns>The created list.</returns>
+ public static NativeList CreateList()
+ {
+ return new NativeList(HBFunctions.hb_list_init());
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs
index cd44e12d8..eba89bcaa 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs
@@ -13,7 +13,7 @@ namespace HandBrake.ApplicationServices.Interop.Helpers
/// The utilities.
/// </summary>
internal static class Utilities
- {
+ {
/// <summary>
/// Get the Greatest Common Factor
/// </summary>
@@ -27,23 +27,23 @@ namespace HandBrake.ApplicationServices.Interop.Helpers
/// The greatest common factor
/// </returns>
public static int GreatestCommonFactor(int a, int b)
- {
- if (a == 0)
- {
- return b;
- }
+ {
+ if (a == 0)
+ {
+ return b;
+ }
- if (b == 0)
- {
- return a;
- }
+ if (b == 0)
+ {
+ return a;
+ }
- if (a > b)
- {
- return GreatestCommonFactor(a % b, b);
- }
+ if (a > b)
+ {
+ return GreatestCommonFactor(a % b, b);
+ }
return GreatestCommonFactor(a, b % a);
- }
- }
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
index 0cc7257a0..a748fc99e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs
@@ -9,19 +9,19 @@
namespace HandBrake.ApplicationServices.Interop.Model
{
- /// <summary>
- /// Represents bitrate limits as a range.
- /// </summary>
- public class BitrateLimits
- {
- /// <summary>
- /// The inclusive lower limit for the bitrate.
- /// </summary>
- public int Low { get; set; }
+ /// <summary>
+ /// Represents bitrate limits as a range.
+ /// </summary>
+ public class BitrateLimits
+ {
+ /// <summary>
+ /// The inclusive lower limit for the bitrate.
+ /// </summary>
+ public int Low { get; set; }
- /// <summary>
- /// The inclusive upper limit for the bitrate.
- /// </summary>
- public int High { get; set; }
- }
+ /// <summary>
+ /// The inclusive upper limit for the bitrate.
+ /// </summary>
+ public int High { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs
index 0c3201155..52c9e64d5 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs
@@ -13,7 +13,7 @@ namespace HandBrake.ApplicationServices.Interop.Model
/// The Cropping Model
/// </summary>
public class Cropping
- {
+ {
/// <summary>
/// Initializes a new instance of the <see cref="Cropping"/> class.
/// </summary>
@@ -86,14 +86,14 @@ namespace HandBrake.ApplicationServices.Interop.Model
/// A Cloned copy
/// </returns>
public Cropping Clone()
- {
- return new Cropping
- {
- Top = this.Top,
- Bottom = this.Bottom,
- Left = this.Left,
- Right = this.Right
- };
- }
- }
+ {
+ return new Cropping
+ {
+ Top = this.Top,
+ Bottom = this.Bottom,
+ Left = this.Left,
+ Right = this.Right
+ };
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/EncodeJob.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/EncodeJob.cs
index 73eb17ad4..9357e21a3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/EncodeJob.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/EncodeJob.cs
@@ -14,17 +14,17 @@ namespace HandBrake.ApplicationServices.Interop.Model
using HandBrake.ApplicationServices.Interop.Model.Encoding;
/// <summary>
- /// The encode job.
- /// </summary>
- public class EncodeJob
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="EncodeJob"/> class.
- /// </summary>
- public EncodeJob()
- {
+ /// The encode job.
+ /// </summary>
+ public class EncodeJob
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeJob"/> class.
+ /// </summary>
+ public EncodeJob()
+ {
this.Cropping = new Cropping();
- }
+ }
#region Source
@@ -415,30 +415,30 @@ namespace HandBrake.ApplicationServices.Interop.Model
#region Public Methods
/// <summary>
- /// The clone.
- /// </summary>
- /// <returns>
- /// The <see cref="EncodeJob"/>.
- /// </returns>
- public EncodeJob Clone()
- {
- var clone = new EncodeJob
- {
- SourceType = this.SourceType,
- SourcePath = this.SourcePath,
- Title = this.Title,
- Angle = this.Angle,
- RangeType = this.RangeType,
- ChapterStart = this.ChapterStart,
- ChapterEnd = this.ChapterEnd,
- SecondsStart = this.SecondsStart,
- SecondsEnd = this.SecondsEnd,
- FramesStart = this.FramesStart,
- FramesEnd = this.FramesEnd,
- Subtitles = this.Subtitles,
- UseDefaultChapterNames = this.UseDefaultChapterNames,
- DxvaDecoding = this.DxvaDecoding,
- OutputPath = this.OutputPath,
+ /// The clone.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="EncodeJob"/>.
+ /// </returns>
+ public EncodeJob Clone()
+ {
+ var clone = new EncodeJob
+ {
+ SourceType = this.SourceType,
+ SourcePath = this.SourcePath,
+ Title = this.Title,
+ Angle = this.Angle,
+ RangeType = this.RangeType,
+ ChapterStart = this.ChapterStart,
+ ChapterEnd = this.ChapterEnd,
+ SecondsStart = this.SecondsStart,
+ SecondsEnd = this.SecondsEnd,
+ FramesStart = this.FramesStart,
+ FramesEnd = this.FramesEnd,
+ Subtitles = this.Subtitles,
+ UseDefaultChapterNames = this.UseDefaultChapterNames,
+ DxvaDecoding = this.DxvaDecoding,
+ OutputPath = this.OutputPath,
ContainerName = this.ContainerName,
PreferredExtension = this.PreferredExtension,
@@ -495,11 +495,11 @@ namespace HandBrake.ApplicationServices.Interop.Model
AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
AudioEncoderFallback = this.AudioEncoderFallback
- };
+ };
- return clone;
- }
+ return clone;
+ }
- #endregion
- }
+ #endregion
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
index 1b77203f4..1fe67db0b 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs
@@ -9,20 +9,20 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
/// <summary>
/// The anamorphic.
/// </summary>
public enum Anamorphic
- {
- [Display(Name = "None")]
- None = 0,
- [Display(Name = "Strict")]
- Strict = 1,
- [Display(Name = "Loose")]
- Loose = 2,
- [Display(Name = "Custom")]
- Custom = 3
- }
+ {
+ [Display(Name = "None")]
+ None = 0,
+ [Display(Name = "Strict")]
+ Strict = 1,
+ [Display(Name = "Loose")]
+ Loose = 2,
+ [Display(Name = "Custom")]
+ Custom = 3
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncodeRateType.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncodeRateType.cs
index 031c89b11..4fe209ccb 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncodeRateType.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncodeRateType.cs
@@ -13,9 +13,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The audio encode rate type.
/// </summary>
public enum AudioEncodeRateType
- {
- Bitrate,
- Quality,
+ {
+ Bitrate,
+ Quality,
Compression
- }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoding.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoding.cs
index 381e9d2c0..96adc79dd 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoding.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoding.cs
@@ -9,81 +9,81 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System;
+ using System;
- /// <summary>
- /// The Audio Encoding Model
- /// </summary>
- public class AudioEncoding
- {
- /// <summary>
- /// Initializes a new instance of the AudioEncoding class.
- /// </summary>
- public AudioEncoding()
- {
- // Initialize to -1 to differentiate a compression of 0 from uninitialized.
- this.Compression = -1;
- }
+ /// <summary>
+ /// The Audio Encoding Model
+ /// </summary>
+ public class AudioEncoding
+ {
+ /// <summary>
+ /// Initializes a new instance of the AudioEncoding class.
+ /// </summary>
+ public AudioEncoding()
+ {
+ // Initialize to -1 to differentiate a compression of 0 from uninitialized.
+ this.Compression = -1;
+ }
- /// <summary>
- /// Gets or sets the chosen track to apply the encoding to.
- /// </summary>
- /// <remarks>1-based index. 0 means apply to all tracks.</remarks>
- public int InputNumber { get; set; }
+ /// <summary>
+ /// Gets or sets the chosen track to apply the encoding to.
+ /// </summary>
+ /// <remarks>1-based index. 0 means apply to all tracks.</remarks>
+ public int InputNumber { get; set; }
- /// <summary>
- /// Gets or sets the encoder to use.
- /// </summary>
- public string Encoder { get; set; }
+ /// <summary>
+ /// Gets or sets the encoder to use.
+ /// </summary>
+ public string Encoder { get; set; }
- /// <summary>
- /// Gets or sets the encode rate type (bitrate or quality).
- /// </summary>
- public AudioEncodeRateType EncodeRateType { get; set; }
+ /// <summary>
+ /// Gets or sets the encode rate type (bitrate or quality).
+ /// </summary>
+ public AudioEncodeRateType EncodeRateType { get; set; }
- /// <summary>
- /// Gets or sets the bitrate (in kbps) of this track.
- /// </summary>
- public int Bitrate { get; set; }
+ /// <summary>
+ /// Gets or sets the bitrate (in kbps) of this track.
+ /// </summary>
+ public int Bitrate { get; set; }
- /// <summary>
- /// Gets or sets the target audio quality for this track.
- /// </summary>
- public float Quality { get; set; }
+ /// <summary>
+ /// Gets or sets the target audio quality for this track.
+ /// </summary>
+ public float Quality { get; set; }
- /// <summary>
- /// Gets or sets the target audio compression for this track.
- /// </summary>
- public float Compression { get; set; }
+ /// <summary>
+ /// Gets or sets the target audio compression for this track.
+ /// </summary>
+ public float Compression { get; set; }
- /// <summary>
- /// Gets or sets the mixdown.
- /// </summary>
- public string Mixdown { get; set; }
+ /// <summary>
+ /// Gets or sets the mixdown.
+ /// </summary>
+ public string Mixdown { get; set; }
- /// <summary>
- /// Gets or sets the sample rate in Hz.
- /// </summary>
- public int SampleRateRaw { get; set; }
+ /// <summary>
+ /// Gets or sets the sample rate in Hz.
+ /// </summary>
+ public int SampleRateRaw { get; set; }
- /// <summary>
- /// Gets or sets Gain.
- /// </summary>
- public int Gain { get; set; }
+ /// <summary>
+ /// Gets or sets Gain.
+ /// </summary>
+ public int Gain { get; set; }
- /// <summary>
- /// Gets or sets Drc.
- /// </summary>
- public double Drc { get; set; }
+ /// <summary>
+ /// Gets or sets Drc.
+ /// </summary>
+ public double Drc { get; set; }
- /// <summary>
- /// Gets or sets Name.
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets Name.
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether is passthru.
- /// </summary>
- public bool IsPassthru { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether is passthru.
+ /// </summary>
+ public bool IsPassthru { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs
index ec59a6dbf..0140c5678 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs
@@ -9,20 +9,20 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System;
- using System.ComponentModel.DataAnnotations;
+ using System;
+ using System.ComponentModel.DataAnnotations;
/// <summary>
/// The container.
/// </summary>
[Flags]
- public enum Container
- {
- None = 0x0,
+ public enum Container
+ {
+ None = 0x0,
- [Display(Name = "MP4")]
- MP4,
- [Display(Name = "MKV")]
- MKV
- }
+ [Display(Name = "MP4")]
+ MP4,
+ [Display(Name = "MKV")]
+ MKV
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
index a63375143..f49ccffc7 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs
@@ -13,11 +13,11 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The decomb.
/// </summary>
public enum Decomb
- {
- Off = 0,
- Default = 2,
- Fast = 3,
- Bob = 4,
- Custom = 1
- }
+ {
+ Off = 0,
+ Default = 2,
+ Fast = 3,
+ Bob = 4,
+ Custom = 1
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
index 1ed41419f..f5f76b71e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs
@@ -13,12 +13,12 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The deinterlace.
/// </summary>
public enum Deinterlace
- {
- Off = 0,
- Fast = 2,
- Slow = 3,
- Slower = 4,
- Bob = 5,
- Custom = 1
- }
+ {
+ Off = 0,
+ Fast = 2,
+ Slow = 3,
+ Slower = 4,
+ Bob = 5,
+ Custom = 1
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
index 2f24251ef..1bb510c29 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs
@@ -13,9 +13,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The denoise.
/// </summary>
public enum Denoise
- {
- Off = 0,
+ {
+ Off = 0,
hqdn3d = 1,
- NLMeans = 2,
- }
+ NLMeans = 2,
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
index d16075af4..ff26a394d 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs
@@ -13,9 +13,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The detelecine.
/// </summary>
public enum Detelecine
- {
- Off = 0,
- Default = 2,
- Custom = 1
- }
+ {
+ Off = 0,
+ Default = 2,
+ Custom = 1
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs
index edae8f29a..e3315878d 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs
@@ -9,19 +9,19 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- /// <summary>
- /// Represents a rate in HandBrake: audio sample rate or video framerate.
- /// </summary>
- public class HBRate
- {
- /// <summary>
- /// Gets or sets the name to use for this rate.
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Represents a rate in HandBrake: audio sample rate or video framerate.
+ /// </summary>
+ public class HBRate
+ {
+ /// <summary>
+ /// Gets or sets the name to use for this rate.
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the raw rate.
- /// </summary>
- public int Rate { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the raw rate.
+ /// </summary>
+ public int Rate { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs
index dd09452a1..a764f76b3 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs
@@ -9,12 +9,12 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System.Collections.Generic;
+ using System.Collections.Generic;
- using HandBrake.ApplicationServices.Interop.HbLib;
- using HandBrake.ApplicationServices.Interop.Helpers;
+ using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Helpers;
- /// <summary>
+ /// <summary>
/// The hb video encoder.
/// </summary>
public class HBVideoEncoder
@@ -39,48 +39,48 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// </summary>
public string ShortName { get; set; }
- /// <summary>
- /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets)
- /// </summary>
- public List<string> Presets
- {
- get
- {
- return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id));
- }
- }
+ /// <summary>
+ /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets)
+ /// </summary>
+ public List<string> Presets
+ {
+ get
+ {
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id));
+ }
+ }
- /// <summary>
- /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes)
- /// </summary>
- public List<string> Tunes
- {
- get
- {
- return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id));
- }
- }
+ /// <summary>
+ /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes)
+ /// </summary>
+ public List<string> Tunes
+ {
+ get
+ {
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id));
+ }
+ }
- /// <summary>
- /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles)
- /// </summary>
- public List<string> Profiles
- {
- get
- {
- return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id));
- }
- }
+ /// <summary>
+ /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles)
+ /// </summary>
+ public List<string> Profiles
+ {
+ get
+ {
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id));
+ }
+ }
- /// <summary>
- /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels)
- /// </summary>
- public List<string> Levels
- {
- get
- {
- return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id));
- }
- }
+ /// <summary>
+ /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels)
+ /// </summary>
+ public List<string> Levels
+ {
+ get
+ {
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id));
+ }
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs
index 4ca750adb..53e4f87e2 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Mixdown.cs
@@ -9,24 +9,24 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- /// <summary>
- /// The Audio Mixdown Enumeration
- /// </summary>
- public enum Mixdown
- {
- [Display(Name = "Dolby Pro Logic II")]
- DolbyProLogicII = 0,
+ /// <summary>
+ /// The Audio Mixdown Enumeration
+ /// </summary>
+ public enum Mixdown
+ {
+ [Display(Name = "Dolby Pro Logic II")]
+ DolbyProLogicII = 0,
[Display(Name = "None")]
None,
- [Display(Name = "Automatic")]
- Auto,
+ [Display(Name = "Automatic")]
+ Auto,
- [Display(Name = "Mono")]
- Mono,
+ [Display(Name = "Mono")]
+ Mono,
[Display(Name = "Mono (Left Only)")]
LeftOnly,
@@ -34,14 +34,14 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
[Display(Name = "Mono (Right Only)")]
RightOnly,
- [Display(Name = "Stereo")]
- Stereo,
+ [Display(Name = "Stereo")]
+ Stereo,
- [Display(Name = "Dolby Surround")]
- DolbySurround,
+ [Display(Name = "Dolby Surround")]
+ DolbySurround,
- [Display(Name = "5.1 Channels")]
- FivePoint1Channels,
+ [Display(Name = "5.1 Channels")]
+ FivePoint1Channels,
[Display(Name = "6.1 Channels")]
SixPoint1Channels,
@@ -51,5 +51,5 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
[Display(Name = "7.1 (5F/2R/LFE)")]
Five_2_LFE,
- }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/OutputExtension.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/OutputExtension.cs
index 08534fd19..5154eb58e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/OutputExtension.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/OutputExtension.cs
@@ -13,8 +13,8 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The output extension.
/// </summary>
public enum OutputExtension
- {
- Mp4,
- M4v
- }
+ {
+ Mp4,
+ M4v
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs
index 38fc68980..76dc2846b 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs
@@ -9,14 +9,14 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- /// <summary>
- /// Possible picture rotations.
- /// </summary>
- public enum PictureRotation
- {
- None = 0,
- Clockwise90,
- Clockwise180,
- Clockwise270
- }
+ /// <summary>
+ /// Possible picture rotations.
+ /// </summary>
+ public enum PictureRotation
+ {
+ None = 0,
+ Clockwise90,
+ Clockwise180,
+ Clockwise270
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs
index 203b5a583..5d49ec2ae 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs
@@ -9,19 +9,19 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- /// <summary>
- /// Enumeration of rescaling algorithms.
- /// </summary>
- public enum ScaleMethod
- {
- /// <summary>
- /// Standard software scaling. Highest quality.
- /// </summary>
- Lanczos = 0,
+ /// <summary>
+ /// Enumeration of rescaling algorithms.
+ /// </summary>
+ public enum ScaleMethod
+ {
+ /// <summary>
+ /// Standard software scaling. Highest quality.
+ /// </summary>
+ Lanczos = 0,
- /// <summary>
- /// OpenCL-assisted bicubic scaling.
- /// </summary>
- Bicubic = 1
- }
+ /// <summary>
+ /// OpenCL-assisted bicubic scaling.
+ /// </summary>
+ Bicubic = 1
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs
index 3fca0466a..beb5ca949 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs
@@ -13,9 +13,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
/// The video encode rate type.
/// </summary>
public enum VideoEncodeRateType
- {
- TargetSize = 0,
- AverageBitrate = 1,
- ConstantQuality = 2
- }
+ {
+ TargetSize = 0,
+ AverageBitrate = 1,
+ ConstantQuality = 2
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
index ce88223bb..0752b1277 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs
@@ -9,34 +9,34 @@
namespace HandBrake.ApplicationServices.Interop.Model.Encoding
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- using HandBrake.ApplicationServices.Interop.Attributes;
+ using HandBrake.ApplicationServices.Interop.Attributes;
/// <summary>
/// The video encoder.
/// </summary>
public enum VideoEncoder
- {
- [Display(Name = "H.264 (x264)")]
+ {
+ [Display(Name = "H.264 (x264)")]
[ShortName("x264")]
- X264 = 0,
+ X264 = 0,
[Display(Name = "H.264 (Intel QSV)")]
[ShortName("qsv_h264")]
QuickSync,
- [Display(Name = "MPEG-4")]
+ [Display(Name = "MPEG-4")]
[ShortName("mpeg4")]
- FFMpeg,
+ FFMpeg,
- [Display(Name = "MPEG-2")]
+ [Display(Name = "MPEG-2")]
[ShortName("mpeg2")]
- FFMpeg2,
+ FFMpeg2,
- [Display(Name = "Theora")]
+ [Display(Name = "Theora")]
[ShortName("theora")]
- Theora,
+ Theora,
[Display(Name = "H.265 (x265)")]
[ShortName("x265")]
@@ -45,5 +45,5 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding
[Display(Name = "VP8")]
[ShortName("vp8")]
VP8
- }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs
index b6a0d61b4..89e997ef8 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs
@@ -9,40 +9,40 @@
namespace HandBrake.ApplicationServices.Interop.Model
{
- /// <summary>
- /// Represents a language.
- /// </summary>
- public class Language
- {
- /// <summary>
- /// Gets or sets the english name of the language.
- /// </summary>
- public string EnglishName { get; set; }
+ /// <summary>
+ /// Represents a language.
+ /// </summary>
+ public class Language
+ {
+ /// <summary>
+ /// Gets or sets the english name of the language.
+ /// </summary>
+ public string EnglishName { get; set; }
- /// <summary>
- /// Gets or sets the native name of the language.
- /// </summary>
- public string NativeName { get; set; }
+ /// <summary>
+ /// Gets or sets the native name of the language.
+ /// </summary>
+ public string NativeName { get; set; }
- /// <summary>
- /// Gets or sets the language code.
- /// </summary>
- public string Code { get; set; }
+ /// <summary>
+ /// Gets or sets the language code.
+ /// </summary>
+ public string Code { get; set; }
- /// <summary>
- /// Gets the display string for the language.
- /// </summary>
- public string Display
- {
- get
- {
- if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName)
- {
- return this.EnglishName + " (" + this.NativeName + ")";
- }
+ /// <summary>
+ /// Gets the display string for the language.
+ /// </summary>
+ public string Display
+ {
+ get
+ {
+ if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName)
+ {
+ return this.EnglishName + " (" + this.NativeName + ")";
+ }
- return this.EnglishName;
- }
- }
- }
+ return this.EnglishName;
+ }
+ }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/AudioTrack.cs
index 4a7fe21a4..527b3c4f6 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/AudioTrack.cs
@@ -10,98 +10,98 @@
namespace HandBrake.ApplicationServices.Interop.Model.Scan
{
/// <summary>
- /// An object represending an AudioTrack associated with a Title, in a DVD
- /// </summary>
- public class AudioTrack
- {
- /// <summary>
- /// Gets or sets the track number of this Audio Track
- /// </summary>
- public int TrackNumber { get; set; }
+ /// An object represending an AudioTrack associated with a Title, in a DVD
+ /// </summary>
+ public class AudioTrack
+ {
+ /// <summary>
+ /// Gets or sets the track number of this Audio Track
+ /// </summary>
+ public int TrackNumber { get; set; }
- /// <summary>
- /// Gets or sets the audio codec ID for this track.
- /// </summary>
- public uint CodecId { get; set; }
+ /// <summary>
+ /// Gets or sets the audio codec ID for this track.
+ /// </summary>
+ public uint CodecId { get; set; }
- /// <summary>
- /// Gets or sets the language (if detected) of this Audio Track
- /// </summary>
- public string Language { get; set; }
+ /// <summary>
+ /// Gets or sets the language (if detected) of this Audio Track
+ /// </summary>
+ public string Language { get; set; }
- /// <summary>
- /// Gets or sets the language code for this audio track.
- /// </summary>
- public string LanguageCode { get; set; }
+ /// <summary>
+ /// Gets or sets the language code for this audio track.
+ /// </summary>
+ public string LanguageCode { get; set; }
- /// <summary>
- /// Gets or sets the description for this audio track.
- /// </summary>
- public string Description { get; set; }
+ /// <summary>
+ /// Gets or sets the description for this audio track.
+ /// </summary>
+ public string Description { get; set; }
- /// <summary>
- /// Gets or sets the channel layout of this Audio Track.
- /// </summary>
- public ulong ChannelLayout { get; set; }
+ /// <summary>
+ /// Gets or sets the channel layout of this Audio Track.
+ /// </summary>
+ public ulong ChannelLayout { get; set; }
- /// <summary>
- /// Gets or sets the frequency (in Hz) of this Audio Track
- /// </summary>
- public int SampleRate { get; set; }
+ /// <summary>
+ /// Gets or sets the frequency (in Hz) of this Audio Track
+ /// </summary>
+ public int SampleRate { get; set; }
- /// <summary>
- /// Gets or sets the bitrate (in bits/sec) of this Audio Track.
- /// </summary>
- public int Bitrate { get; set; }
+ /// <summary>
+ /// Gets or sets the bitrate (in bits/sec) of this Audio Track.
+ /// </summary>
+ public int Bitrate { get; set; }
- /// <summary>
- /// Gets the display string for this audio track.
- /// </summary>
- public string Display
- {
- get
- {
- return this.GetDisplayString(true);
- }
- }
+ /// <summary>
+ /// Gets the display string for this audio track.
+ /// </summary>
+ public string Display
+ {
+ get
+ {
+ return this.GetDisplayString(true);
+ }
+ }
- /// <summary>
- /// Gets the display string for this audio track (not including track number)
- /// </summary>
- public string NoTrackDisplay
- {
- get
- {
- return this.GetDisplayString(false);
- }
- }
+ /// <summary>
+ /// Gets the display string for this audio track (not including track number)
+ /// </summary>
+ public string NoTrackDisplay
+ {
+ get
+ {
+ return this.GetDisplayString(false);
+ }
+ }
- /// <summary>
- /// Override of the ToString method to make this object easier to use in the UI
- /// </summary>
- /// <returns>A string formatted as: {track #} {language} ({format}) ({sub-format})</returns>
- public override string ToString()
- {
- return this.GetDisplayString(true);
- }
+ /// <summary>
+ /// Override of the ToString method to make this object easier to use in the UI
+ /// </summary>
+ /// <returns>A string formatted as: {track #} {language} ({format}) ({sub-format})</returns>
+ public override string ToString()
+ {
+ return this.GetDisplayString(true);
+ }
- /// <summary>
- /// The get display string.
- /// </summary>
- /// <param name="includeTrackNumber">
- /// The include track number.
- /// </param>
- /// <returns>
- /// The <see cref="string"/>.
- /// </returns>
- private string GetDisplayString(bool includeTrackNumber)
- {
- if (includeTrackNumber)
- {
- return this.TrackNumber + " " + this.Description;
- }
-
+ /// <summary>
+ /// The get display string.
+ /// </summary>
+ /// <param name="includeTrackNumber">
+ /// The include track number.
+ /// </param>
+ /// <returns>
+ /// The <see cref="string"/>.
+ /// </returns>
+ private string GetDisplayString(bool includeTrackNumber)
+ {
+ if (includeTrackNumber)
+ {
+ return this.TrackNumber + " " + this.Description;
+ }
+
return this.Description;
- }
- }
+ }
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Chapter.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Chapter.cs
index f0e63ba3e..720906059 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Chapter.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Chapter.cs
@@ -13,32 +13,32 @@ namespace HandBrake.ApplicationServices.Interop.Model.Scan
using System.Globalization;
/// <summary>
- /// An object representing a Chapter aosciated with a Title, in a DVD
- /// </summary>
- public class Chapter
- {
+ /// An object representing a Chapter aosciated with a Title, in a DVD
+ /// </summary>
+ public class Chapter
+ {
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name { get; set; }
- /// <summary>
- /// Gets or sets the number of this Chapter, in regards to its parent Title
- /// </summary>
- public int ChapterNumber { get; set; }
+ /// <summary>
+ /// Gets or sets the number of this Chapter, in regards to its parent Title
+ /// </summary>
+ public int ChapterNumber { get; set; }
- /// <summary>
- /// Gets or sets the duration of this chapter.
- /// </summary>
- public TimeSpan Duration { get; set; }
+ /// <summary>
+ /// Gets or sets the duration of this chapter.
+ /// </summary>
+ public TimeSpan Duration { get; set; }
- /// <summary>
- /// Override of the ToString method to make this object easier to use in the UI
- /// </summary>
- /// <returns>A string formatted as: {chapter #}</returns>
- public override string ToString()
- {
- return this.ChapterNumber.ToString(CultureInfo.InvariantCulture);
- }
- }
+ /// <summary>
+ /// Override of the ToString method to make this object easier to use in the UI
+ /// </summary>
+ /// <returns>A string formatted as: {chapter #}</returns>
+ public override string ToString()
+ {
+ return this.ChapterNumber.ToString(CultureInfo.InvariantCulture);
+ }
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/InputType.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/InputType.cs
index 892d68116..4366d5a74 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/InputType.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/InputType.cs
@@ -15,17 +15,17 @@ namespace HandBrake.ApplicationServices.Interop.Model.Scan
/// The input type.
/// </summary>
public enum InputType
- {
- [Display(Name = "File")]
- Stream,
+ {
+ [Display(Name = "File")]
+ Stream,
- [Display(Name = "DVD")]
- Dvd,
+ [Display(Name = "DVD")]
+ Dvd,
- [Display(Name = "Blu-ray")]
- Bluray,
+ [Display(Name = "Blu-ray")]
+ Bluray,
[Display(Name = "File")]
FFStream
- }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Subtitle.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Subtitle.cs
index 7e09d21c5..6f8a5b027 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Subtitle.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Subtitle.cs
@@ -12,85 +12,85 @@ namespace HandBrake.ApplicationServices.Interop.Model.Scan
using HandBrake.ApplicationServices.Interop.HbLib;
/// <summary>
- /// An object that represents a subtitle associated with a Title, in a DVD
- /// </summary>
- public class Subtitle
- {
- /// <summary>
- /// Gets or sets the track number of this Subtitle
- /// </summary>
- public int TrackNumber { get; set; }
+ /// An object that represents a subtitle associated with a Title, in a DVD
+ /// </summary>
+ public class Subtitle
+ {
+ /// <summary>
+ /// Gets or sets the track number of this Subtitle
+ /// </summary>
+ public int TrackNumber { get; set; }
- /// <summary>
- /// Gets or sets the language (if detected) of this Subtitle
- /// </summary>
- public string Language { get; set; }
+ /// <summary>
+ /// Gets or sets the language (if detected) of this Subtitle
+ /// </summary>
+ public string Language { get; set; }
- /// <summary>
- /// Gets or sets the Langauage Code.
- /// </summary>
- public string LanguageCode { get; set; }
+ /// <summary>
+ /// Gets or sets the Langauage Code.
+ /// </summary>
+ public string LanguageCode { get; set; }
- /// <summary>
- /// Gets or sets the subtitle source.
- /// </summary>
- public SubtitleSource SubtitleSource { get; set; }
+ /// <summary>
+ /// Gets or sets the subtitle source.
+ /// </summary>
+ public SubtitleSource SubtitleSource { get; set; }
- /// <summary>
- /// Gets or sets the subtitle source raw integer.
- /// </summary>
- public int SubtitleSourceInt { get; set; }
+ /// <summary>
+ /// Gets or sets the subtitle source raw integer.
+ /// </summary>
+ public int SubtitleSourceInt { get; set; }
- /// <summary>
- /// Gets a value indicating whether the "forced only" flag can be set on this subtitle.
- /// </summary>
- public bool CanSetForcedOnly
- {
- get
- {
- return HBFunctions.hb_subtitle_can_force(this.SubtitleSourceInt) > 0;
- }
- }
+ /// <summary>
+ /// Gets a value indicating whether the "forced only" flag can be set on this subtitle.
+ /// </summary>
+ public bool CanSetForcedOnly
+ {
+ get
+ {
+ return HBFunctions.hb_subtitle_can_force(this.SubtitleSourceInt) > 0;
+ }
+ }
- /// <summary>
- /// Gets a value indicating whether this subtitle can be burned into the picture.
- /// </summary>
- public bool CanBurn
- {
- get
- {
- return HBFunctions.hb_subtitle_can_burn(this.SubtitleSourceInt) > 0;
- }
- }
+ /// <summary>
+ /// Gets a value indicating whether this subtitle can be burned into the picture.
+ /// </summary>
+ public bool CanBurn
+ {
+ get
+ {
+ return HBFunctions.hb_subtitle_can_burn(this.SubtitleSourceInt) > 0;
+ }
+ }
- /// <summary>
- /// Returns true if the subtitle can be passed through using the given muxer.
- /// </summary>
- /// <param name="muxer">The muxer ID.</param>
- /// <returns>True if the subtitle can be passed through.</returns>
- public bool CanPass(int muxer)
- {
- return HBFunctions.hb_subtitle_can_pass(this.SubtitleSourceInt, muxer) > 0;
- }
+ /// <summary>
+ /// Returns true if the subtitle can be passed through using the given muxer.
+ /// </summary>
+ /// <param name="muxer">The muxer ID.</param>
+ /// <returns>True if the subtitle can be passed through.</returns>
+ public bool CanPass(int muxer)
+ {
+ return HBFunctions.hb_subtitle_can_pass(this.SubtitleSourceInt, muxer) > 0;
+ }
- /// <summary>
- /// Override of the ToString method to make this object easier to use in the UI
- /// </summary>
- /// <returns>A string formatted as: {track #} {language}</returns>
- public override string ToString()
- {
- return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource);
- }
+ /// <summary>
+ /// Override of the ToString method to make this object easier to use in the UI
+ /// </summary>
+ /// <returns>A string formatted as: {track #} {language}</returns>
+ public override string ToString()
+ {
+ return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource);
+ }
- /// <summary>
- /// Gets the display.
- /// </summary>
- public string Display
- {
- get
- {
- return this.ToString();
- }
- }
- }
+ /// <summary>
+ /// Gets the display.
+ /// </summary>
+ public string Display
+ {
+ get
+ {
+ return this.ToString();
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/SubtitleSource.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/SubtitleSource.cs
index e29a1a413..d51ff4ef6 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/SubtitleSource.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/SubtitleSource.cs
@@ -13,14 +13,14 @@ namespace HandBrake.ApplicationServices.Interop.Model.Scan
/// The subtitle source.
/// </summary>
public enum SubtitleSource
- {
- VobSub,
- SRT,
- CC608,
- CC708,
- UTF8,
- TX3G,
- SSA,
- PGS
- }
+ {
+ VobSub,
+ SRT,
+ CC608,
+ CC708,
+ UTF8,
+ TX3G,
+ SSA,
+ PGS
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Title.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Title.cs
index fc8f6ea07..37013ac48 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Title.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Scan/Title.cs
@@ -15,170 +15,170 @@ namespace HandBrake.ApplicationServices.Interop.Model.Scan
using HandBrake.ApplicationServices.Interop.Model;
/// <summary>
- /// An object that represents a single Title of a DVD
- /// </summary>
- public class Title
- {
- /// <summary>
- /// The audio tracks.
- /// </summary>
- private readonly List<AudioTrack> audioTracks;
-
- /// <summary>
- /// The chapters.
- /// </summary>
- private readonly List<Chapter> chapters;
-
- /// <summary>
- /// The subtitles.
- /// </summary>
- private readonly List<Subtitle> subtitles;
-
- /// <summary>
- /// Initializes a new instance of the Title class.
- /// </summary>
- public Title()
- {
- this.audioTracks = new List<AudioTrack>();
- this.chapters = new List<Chapter>();
- this.subtitles = new List<Subtitle>();
- }
-
- /// <summary>
- /// Gets or sets the input type of this title.
- /// </summary>
- public InputType InputType { get; set; }
-
- /// <summary>
- /// Gets a collection of chapters in this Title
- /// </summary>
- public List<Chapter> Chapters
- {
- get { return this.chapters; }
- }
-
- /// <summary>
- /// Gets a collection of audio tracks associated with this Title
- /// </summary>
- public List<AudioTrack> AudioTracks
- {
- get { return this.audioTracks; }
- }
-
- /// <summary>
- /// Gets a collection of subtitles associated with this Title
- /// </summary>
- public List<Subtitle> Subtitles
- {
- get { return this.subtitles; }
- }
-
- /// <summary>
- /// Gets or sets the track number of this Title (1-based).
- /// </summary>
- public int TitleNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the playlist number this title came from.
- /// </summary>
- public int Playlist { get; set; }
-
- /// <summary>
- /// Gets or sets the duration of this title.
- /// </summary>
- public TimeSpan Duration { get; set; }
-
- /// <summary>
- /// Gets or sets the resolution (width/height) of this Title
- /// </summary>
- public Size Resolution { get; set; }
-
- /// <summary>
- /// Gets or sets the number of angles on the title.
- /// </summary>
- public int AngleCount { get; set; }
-
- /// <summary>
- /// Gets or sets the pixel aspect ratio.
- /// </summary>
- public Size ParVal { get; set; }
-
- /// <summary>
- /// Gets or sets the automatically detected crop region for this Title.
- /// </summary>
- public Cropping AutoCropDimensions { get; set; }
-
- /// <summary>
- /// Gets or sets the name of the video codec for this title.
- /// </summary>
- public string VideoCodecName { get; set; }
-
- /// <summary>
- /// Gets or sets the video frame rate for this title.
- /// </summary>
- public double Framerate { get; set; }
-
- /// <summary>
- /// Gets or sets the video frame rate numerator.
- /// </summary>
- public int FramerateNumerator { get; set; }
-
- /// <summary>
- /// Gets or sets the video frame rate denominator.
- /// </summary>
- public int FramerateDenominator { get; set; }
-
- /// <summary>
- /// Gets the total number of frames in this title.
- /// </summary>
- public int Frames
- {
- get
- {
- return (int)Math.Ceiling(this.Duration.TotalSeconds * this.Framerate);
- }
- }
-
- /// <summary>
- /// Gets or sets the path.
- /// </summary>
- public string Path { get; set; }
-
- /// <summary>
- /// Override of the ToString method to provide an easy way to use this object in the UI
- /// </summary>
- /// <returns>A string representing this track in the format: {title #}[ {playlist source}] (00:00:00)</returns>
- public override string ToString()
- {
- string playlistPortion = string.Empty;
- if (this.InputType == InputType.Bluray)
- {
- playlistPortion = string.Format(" {0:d5}.MPLS", this.Playlist);
- }
-
- return string.Format(
- "{0}{1} ({2:00}:{3:00}:{4:00})",
- this.TitleNumber,
- playlistPortion,
- this.Duration.Hours,
- this.Duration.Minutes,
- this.Duration.Seconds);
- }
-
- /// <summary>
- /// Gets the display string for this title.
- /// </summary>
- public string Display
- {
- get
- {
- return this.ToString();
- }
- }
+ /// An object that represents a single Title of a DVD
+ /// </summary>
+ public class Title
+ {
+ /// <summary>
+ /// The audio tracks.
+ /// </summary>
+ private readonly List<AudioTrack> audioTracks;
+
+ /// <summary>
+ /// The chapters.
+ /// </summary>
+ private readonly List<Chapter> chapters;
+
+ /// <summary>
+ /// The subtitles.
+ /// </summary>
+ private readonly List<Subtitle> subtitles;
+
+ /// <summary>
+ /// Initializes a new instance of the Title class.
+ /// </summary>
+ public Title()
+ {
+ this.audioTracks = new List<AudioTrack>();
+ this.chapters = new List<Chapter>();
+ this.subtitles = new List<Subtitle>();
+ }
+
+ /// <summary>
+ /// Gets or sets the input type of this title.
+ /// </summary>
+ public InputType InputType { get; set; }
+
+ /// <summary>
+ /// Gets a collection of chapters in this Title
+ /// </summary>
+ public List<Chapter> Chapters
+ {
+ get { return this.chapters; }
+ }
+
+ /// <summary>
+ /// Gets a collection of audio tracks associated with this Title
+ /// </summary>
+ public List<AudioTrack> AudioTracks
+ {
+ get { return this.audioTracks; }
+ }
+
+ /// <summary>
+ /// Gets a collection of subtitles associated with this Title
+ /// </summary>
+ public List<Subtitle> Subtitles
+ {
+ get { return this.subtitles; }
+ }
+
+ /// <summary>
+ /// Gets or sets the track number of this Title (1-based).
+ /// </summary>
+ public int TitleNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the playlist number this title came from.
+ /// </summary>
+ public int Playlist { get; set; }
+
+ /// <summary>
+ /// Gets or sets the duration of this title.
+ /// </summary>
+ public TimeSpan Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets the resolution (width/height) of this Title
+ /// </summary>
+ public Size Resolution { get; set; }
+
+ /// <summary>
+ /// Gets or sets the number of angles on the title.
+ /// </summary>
+ public int AngleCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect ratio.
+ /// </summary>
+ public Size ParVal { get; set; }
+
+ /// <summary>
+ /// Gets or sets the automatically detected crop region for this Title.
+ /// </summary>
+ public Cropping AutoCropDimensions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name of the video codec for this title.
+ /// </summary>
+ public string VideoCodecName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video frame rate for this title.
+ /// </summary>
+ public double Framerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video frame rate numerator.
+ /// </summary>
+ public int FramerateNumerator { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video frame rate denominator.
+ /// </summary>
+ public int FramerateDenominator { get; set; }
+
+ /// <summary>
+ /// Gets the total number of frames in this title.
+ /// </summary>
+ public int Frames
+ {
+ get
+ {
+ return (int)Math.Ceiling(this.Duration.TotalSeconds * this.Framerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the path.
+ /// </summary>
+ public string Path { get; set; }
+
+ /// <summary>
+ /// Override of the ToString method to provide an easy way to use this object in the UI
+ /// </summary>
+ /// <returns>A string representing this track in the format: {title #}[ {playlist source}] (00:00:00)</returns>
+ public override string ToString()
+ {
+ string playlistPortion = string.Empty;
+ if (this.InputType == InputType.Bluray)
+ {
+ playlistPortion = string.Format(" {0:d5}.MPLS", this.Playlist);
+ }
+
+ return string.Format(
+ "{0}{1} ({2:00}:{3:00}:{4:00})",
+ this.TitleNumber,
+ playlistPortion,
+ this.Duration.Hours,
+ this.Duration.Minutes,
+ this.Duration.Seconds);
+ }
+
+ /// <summary>
+ /// Gets the display string for this title.
+ /// </summary>
+ public string Display
+ {
+ get
+ {
+ return this.ToString();
+ }
+ }
/// <summary>
/// Gets or sets a value indicating whether is main feature.
/// </summary>
public bool IsMainFeature { get; set; }
- }
+ }
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/SrtSubtitle.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/SrtSubtitle.cs
index 98c9e8d08..c81c07ea5 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/SrtSubtitle.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/SrtSubtitle.cs
@@ -24,10 +24,10 @@ namespace HandBrake.ApplicationServices.Interop.Model
/// </summary>
public bool Default { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the subtitle track should be burned in.
- /// </summary>
- public bool BurnedIn { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the subtitle track should be burned in.
+ /// </summary>
+ public bool BurnedIn { get; set; }
/// <summary>
/// Gets or sets the file name.
@@ -55,7 +55,7 @@ namespace HandBrake.ApplicationServices.Interop.Model
return new SrtSubtitle
{
Default = this.Default,
- BurnedIn = this.BurnedIn,
+ BurnedIn = this.BurnedIn,
FileName = this.FileName,
LanguageCode = this.LanguageCode,
CharacterCode = this.CharacterCode,
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs
index 821d58e9a..bd9c1f5d4 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs
@@ -9,29 +9,29 @@
namespace HandBrake.ApplicationServices.Interop.Model
{
- /// <summary>
- /// Represents limits on video quality for a particular encoder.
- /// </summary>
- public class VideoQualityLimits
- {
- /// <summary>
- /// Gets or sets the inclusive lower limit for the quality.
- /// </summary>
- public float Low { get; set; }
+ /// <summary>
+ /// Represents limits on video quality for a particular encoder.
+ /// </summary>
+ public class VideoQualityLimits
+ {
+ /// <summary>
+ /// Gets or sets the inclusive lower limit for the quality.
+ /// </summary>
+ public float Low { get; set; }
- /// <summary>
- /// Gets or sets the inclusive upper limit for the quality.
- /// </summary>
- public float High { get; set; }
+ /// <summary>
+ /// Gets or sets the inclusive upper limit for the quality.
+ /// </summary>
+ public float High { get; set; }
- /// <summary>
- /// Gets or sets the granularity for the quality.
- /// </summary>
- public float Granularity { get; set; }
+ /// <summary>
+ /// Gets or sets the granularity for the quality.
+ /// </summary>
+ public float Granularity { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the quality increases as the number increases.
- /// </summary>
- public bool Ascending { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether the quality increases as the number increases.
+ /// </summary>
+ public bool Ascending { get; set; }
+ }
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoRangeType.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoRangeType.cs
index 89e0f3af4..3b38de793 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoRangeType.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoRangeType.cs
@@ -9,35 +9,35 @@
namespace HandBrake.ApplicationServices.Interop.Model
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- /// <summary>
- /// The video range type.
- /// </summary>
- public enum VideoRangeType
- {
- /// <summary>
- /// The entire title.
- /// </summary>
- [Display(Name = "Preview")]
- Preview,
+ /// <summary>
+ /// The video range type.
+ /// </summary>
+ public enum VideoRangeType
+ {
+ /// <summary>
+ /// The entire title.
+ /// </summary>
+ [Display(Name = "Preview")]
+ Preview,
- /// <summary>
- /// A chapter range.
- /// </summary>
- [Display(Name = "Chapters")]
- Chapters,
+ /// <summary>
+ /// A chapter range.
+ /// </summary>
+ [Display(Name = "Chapters")]
+ Chapters,
- /// <summary>
- /// A timespan range in seconds.
- /// </summary>
- [Display(Name = "Seconds")]
- Seconds,
+ /// <summary>
+ /// A timespan range in seconds.
+ /// </summary>
+ [Display(Name = "Seconds")]
+ Seconds,
- /// <summary>
- /// A frame range.
- /// </summary>
- [Display(Name = "Frames")]
- Frames
- }
+ /// <summary>
+ /// A frame range.
+ /// </summary>
+ [Display(Name = "Frames")]
+ Frames
+ }
} \ No newline at end of file