From: sr55 Date: Sat, 28 Feb 2015 20:37:38 +0000 (+0000) Subject: WinGui: Tabs -> Spaces. X-Git-Tag: 1.0.0~1382 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=261db2cdb6572771fac4772f31480fe9a9969474;p=handbrake WinGui: Tabs -> Spaces. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6952 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- 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 /// public class EncodeCompletedEventArgs : EventArgs - { - /// - /// Gets or sets a value indicating whether an error occurred during the encode. - /// - public bool Error { get; set; } - } + { + /// + /// Gets or sets a value indicating whether an error occurred during the encode. + /// + 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 /// public class EncodeProgressEventArgs : EventArgs - { - /// - /// Gets or sets FractionComplete. - /// + { + /// + /// Gets or sets FractionComplete. + /// public double FractionComplete { get; set; } - /// - /// Gets or sets CurrentFrameRate. - /// + /// + /// Gets or sets CurrentFrameRate. + /// public double CurrentFrameRate { get; set; } - /// - /// Gets or sets AverageFrameRate. - /// + /// + /// Gets or sets AverageFrameRate. + /// public double AverageFrameRate { get; set; } - /// - /// Gets or sets EstimatedTimeLeft. - /// - public TimeSpan EstimatedTimeLeft { get; set; } + /// + /// Gets or sets EstimatedTimeLeft. + /// + public TimeSpan EstimatedTimeLeft { get; set; } - /// - /// Gets or sets the current encoding pass. (-1: subtitle scan, 1: first pass, 2: second pass) - /// - public int Pass { get; set; } - } + /// + /// Gets or sets the current encoding pass. (-1: subtitle scan, 1: first pass, 2: second pass) + /// + 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; /// - /// The Message Logged Event Args - /// - public class MessageLoggedEventArgs : EventArgs - { - /// - /// Gets or sets Message. - /// - public string Message { get; set; } - } + /// The Message Logged Event Args + /// + public class MessageLoggedEventArgs : EventArgs + { + /// + /// Gets or sets Message. + /// + 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; - /// - /// The Scan Progress Event Args - /// - public class ScanProgressEventArgs : EventArgs - { - /// - /// Gets or sets the total progress fraction for the scan. - /// - public double Progress { get; set; } + /// + /// The Scan Progress Event Args + /// + public class ScanProgressEventArgs : EventArgs + { + /// + /// Gets or sets the total progress fraction for the scan. + /// + public double Progress { get; set; } - /// - /// Gets or sets the current preview being processed on the scan. - /// - public int CurrentPreview { get; set; } + /// + /// Gets or sets the current preview being processed on the scan. + /// + public int CurrentPreview { get; set; } - /// - /// Gets or sets the total number of previews to process. - /// - public int Previews { get; set; } + /// + /// Gets or sets the total number of previews to process. + /// + public int Previews { get; set; } - /// - /// Gets or sets the current title being processed on the scan. - /// - public int CurrentTitle { get; set; } + /// + /// Gets or sets the current title being processed on the scan. + /// + public int CurrentTitle { get; set; } - /// - /// Gets or sets the total number of titles to process. - /// - public int Titles { get; set; } - } + /// + /// Gets or sets the total number of titles to process. + /// + 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; /// - /// The encoders. - /// - public static class HandBrakeEncoderHelpers - { - /// - /// The audio encoders. - /// - private static List audioEncoders; - - /// - /// The video encoders. - /// - private static List videoEncoders; - - /// - /// Video framerates in pts. - /// - private static List videoFramerates; - - /// - /// List of HandBrake mixdowns. - /// - private static List mixdowns; - - /// - /// List of HandBrake containers. - /// - private static List containers; - - /// - /// The audio bitrates. - /// - private static List audioBitrates; - - /// - /// Audio sample rates in Hz. - /// - private static List audioSampleRates; - - /// + /// The encoders. + /// + public static class HandBrakeEncoderHelpers + { + /// + /// The audio encoders. + /// + private static List audioEncoders; + + /// + /// The video encoders. + /// + private static List videoEncoders; + + /// + /// Video framerates in pts. + /// + private static List videoFramerates; + + /// + /// List of HandBrake mixdowns. + /// + private static List mixdowns; + + /// + /// List of HandBrake containers. + /// + private static List containers; + + /// + /// The audio bitrates. + /// + private static List audioBitrates; + + /// + /// Audio sample rates in Hz. + /// + private static List audioSampleRates; + + /// /// Initializes static members of the HandBrakeEncoderHelpers class. - /// + /// static HandBrakeEncoderHelpers() - { - HandBrakeUtils.EnsureGlobalInit(); - } - - /// - /// Gets a list of supported audio encoders. - /// - public static List AudioEncoders - { - get - { - if (audioEncoders == null) - { + { + HandBrakeUtils.EnsureGlobalInit(); + } + + /// + /// Gets a list of supported audio encoders. + /// + public static List AudioEncoders + { + get + { + if (audioEncoders == null) + { audioEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder); - } - - return audioEncoders; - } - } - - /// - /// Gets a list of supported video encoders. - /// - public static List VideoEncoders - { - get - { - if (videoEncoders == null) - { + } + + return audioEncoders; + } + } + + /// + /// Gets a list of supported video encoders. + /// + public static List VideoEncoders + { + get + { + if (videoEncoders == null) + { videoEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder); - } - - return videoEncoders; - } - } - - /// - /// Gets a list of supported video framerates (in pts). - /// - public static List VideoFramerates - { - get - { - if (videoFramerates == null) - { + } + + return videoEncoders; + } + } + + /// + /// Gets a list of supported video framerates (in pts). + /// + public static List VideoFramerates + { + get + { + if (videoFramerates == null) + { videoFramerates = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); - } - - return videoFramerates; - } - } - - /// - /// Gets a list of supported mixdowns. - /// - public static List Mixdowns - { - get - { - if (mixdowns == null) - { + } + + return videoFramerates; + } + } + + /// + /// Gets a list of supported mixdowns. + /// + public static List Mixdowns + { + get + { + if (mixdowns == null) + { mixdowns = InteropUtilities.ToListFromIterator(HBFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown); - } - - return mixdowns; - } - } - - /// - /// Gets a list of supported audio bitrates. - /// - public static List AudioBitrates - { - get - { - if (audioBitrates == null) - { - audioBitrates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_bitrate_get_next, b => b.rate); - } - - return audioBitrates; - } - } - - /// - /// Gets a list of supported audio sample rates (in Hz). - /// - public static List AudioSampleRates - { - get - { - if (audioSampleRates == null) - { + } + + return mixdowns; + } + } + + /// + /// Gets a list of supported audio bitrates. + /// + public static List AudioBitrates + { + get + { + if (audioBitrates == null) + { + audioBitrates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_bitrate_get_next, b => b.rate); + } + + return audioBitrates; + } + } + + /// + /// Gets a list of supported audio sample rates (in Hz). + /// + public static List AudioSampleRates + { + get + { + if (audioSampleRates == null) + { audioSampleRates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); - } - - return audioSampleRates; - } - } - - /// - /// Gets a list of supported containers. - /// - public static List Containers - { - get - { - if (containers == null) - { + } + + return audioSampleRates; + } + } + + /// + /// Gets a list of supported containers. + /// + public static List Containers + { + get + { + if (containers == null) + { containers = InteropUtilities.ToListFromIterator(HBFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer); - } - - return containers; - } - } - - /// - /// Gets a value indicating whether SRT subtitles can be burnt in. - /// - public static bool CanBurnSrt - { - get - { - return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0; - } - } - - /// - /// Gets the audio encoder with the specified short name. - /// - /// - /// The name of the audio encoder. - /// - /// - /// The requested audio encoder. - /// - public static HBAudioEncoder GetAudioEncoder(string shortName) - { - return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName); - } - - /// - /// Gets the audio encoder with the specified codec ID. - /// - /// - /// The ID of the audio encoder. - /// - /// - /// The requested audio encoder. - /// - public static HBAudioEncoder GetAudioEncoder(int codecId) - { - return AudioEncoders.SingleOrDefault(e => e.Id == codecId); - } - - /// - /// Gets the video encoder with the specified short name. - /// - /// - /// The name of the video encoder. - /// - /// - /// The requested video encoder. - /// - public static HBVideoEncoder GetVideoEncoder(string shortName) - { - return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName); - } - - /// - /// Gets the mixdown with the specified short name. - /// - /// - /// The name of the mixdown. - /// - /// - /// The requested mixdown. - /// - public static HBMixdown GetMixdown(string shortName) - { - return Mixdowns.SingleOrDefault(m => m.ShortName == shortName); - } - - /// - /// Gets the container with the specified short name. - /// - /// - /// The name of the container. - /// - /// - /// The requested container. - /// - public static HBContainer GetContainer(string shortName) - { - return Containers.SingleOrDefault(c => c.ShortName == shortName); - } - - /// - /// Determines if the given encoder is compatible with the given track. - /// - /// - /// The audio track to examine. - /// - /// - /// The encoder to examine. - /// - /// - /// True if the given encoder is comatible with the given audio track. - /// - /// - /// Only works with passthrough encoders. - /// - public static bool AudioEncoderIsCompatible(AudioTrack track, HBAudioEncoder encoder) - { - return (track.CodecId & encoder.Id) > 0; - } - - /// - /// Determines if the given mixdown supports the given channel layout. - /// - /// - /// The mixdown to evaluate. - /// - /// - /// The channel layout to evaluate. - /// - /// - /// True if the mixdown supports the given channel layout. - /// - public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout) - { - return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; - } - - /// - /// Determines if the given encoder supports the given mixdown. - /// - /// - /// The mixdown to evaluate. - /// - /// - /// The encoder to evaluate. - /// - /// - /// True if the encoder supports the mixdown. - /// - public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) - { - return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint) encoder.Id) > 0; - } - - /// - /// Determines if DRC can be applied to the given track with the given encoder. - /// - /// - /// The track to apply DRC to. - /// - /// - /// The encoder to use for DRC. - /// - /// - /// The title. - /// - /// - /// True if DRC can be applied to the track with the given encoder. - /// - 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; - } - - /// - /// Determines if the given input audio codec can be passed through. - /// - /// - /// The input codec to consider. - /// - /// - /// True if the codec can be passed through. - /// - public static bool CanPassthroughAudio(int codecId) - { - return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0; - } - - /// - /// Sanitizes a mixdown given the output codec and input channel layout. - /// - /// - /// The desired mixdown. - /// - /// - /// The output encoder to be used. - /// - /// - /// The input channel layout. - /// - /// - /// A sanitized mixdown value. - /// - 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); - } - - /// - /// Gets the default mixdown for the given audio encoder and channel layout. - /// - /// - /// The output codec to be used. - /// - /// - /// The input channel layout. - /// - /// - /// The default mixdown for the given codec and channel layout. - /// - 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); - } - - /// - /// Gets the bitrate limits for the given audio codec, sample rate and mixdown. - /// - /// - /// The audio encoder used. - /// - /// - /// The sample rate used (Hz). - /// - /// - /// The mixdown used. - /// - /// - /// Limits on the audio bitrate for the given settings. - /// - 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 }; - } - - /// - /// Gets the video quality limits for the given video codec. - /// - /// - /// The video encoder to check. - /// - /// - /// Limits on the video quality for the encoder. - /// - 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 - }; - } - - /// - /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown. - /// - /// - /// The desired audio bitrate. - /// - /// - /// The output encoder to be used. - /// - /// - /// The output sample rate to be used. - /// - /// - /// The mixdown to be used. - /// - /// - /// A sanitized audio bitrate. - /// - 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); - } - - /// - /// Gets the default audio bitrate for the given parameters. - /// - /// - /// The encoder to use. - /// - /// - /// The sample rate to use. - /// - /// - /// The mixdown to use. - /// - /// - /// The default bitrate for these parameters. - /// - public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) - { - return HBFunctions.hb_audio_bitrate_get_default((uint) encoder.Id, sampleRate, mixdown.Id); - } - - /// - /// Gets limits on audio quality for a given encoder. - /// - /// - /// The audio encoder ID. - /// - /// - /// Limits on the audio quality for the given encoder. - /// - 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 - }; - } - - /// - /// Gets limits on audio compression for a given encoder. - /// - /// - /// The audio encoder ID. - /// - /// - /// Limits on the audio compression for the given encoder. - /// - 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; + } + } + + /// + /// Gets a value indicating whether SRT subtitles can be burnt in. + /// + public static bool CanBurnSrt + { + get + { + return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0; + } + } + + /// + /// Gets the audio encoder with the specified short name. + /// + /// + /// The name of the audio encoder. + /// + /// + /// The requested audio encoder. + /// + public static HBAudioEncoder GetAudioEncoder(string shortName) + { + return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName); + } + + /// + /// Gets the audio encoder with the specified codec ID. + /// + /// + /// The ID of the audio encoder. + /// + /// + /// The requested audio encoder. + /// + public static HBAudioEncoder GetAudioEncoder(int codecId) + { + return AudioEncoders.SingleOrDefault(e => e.Id == codecId); + } + + /// + /// Gets the video encoder with the specified short name. + /// + /// + /// The name of the video encoder. + /// + /// + /// The requested video encoder. + /// + public static HBVideoEncoder GetVideoEncoder(string shortName) + { + return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName); + } + + /// + /// Gets the mixdown with the specified short name. + /// + /// + /// The name of the mixdown. + /// + /// + /// The requested mixdown. + /// + public static HBMixdown GetMixdown(string shortName) + { + return Mixdowns.SingleOrDefault(m => m.ShortName == shortName); + } + + /// + /// Gets the container with the specified short name. + /// + /// + /// The name of the container. + /// + /// + /// The requested container. + /// + public static HBContainer GetContainer(string shortName) + { + return Containers.SingleOrDefault(c => c.ShortName == shortName); + } + + /// + /// Determines if the given encoder is compatible with the given track. + /// + /// + /// The audio track to examine. + /// + /// + /// The encoder to examine. + /// + /// + /// True if the given encoder is comatible with the given audio track. + /// + /// + /// Only works with passthrough encoders. + /// + public static bool AudioEncoderIsCompatible(AudioTrack track, HBAudioEncoder encoder) + { + return (track.CodecId & encoder.Id) > 0; + } + + /// + /// Determines if the given mixdown supports the given channel layout. + /// + /// + /// The mixdown to evaluate. + /// + /// + /// The channel layout to evaluate. + /// + /// + /// True if the mixdown supports the given channel layout. + /// + public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout) + { + return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; + } + + /// + /// Determines if the given encoder supports the given mixdown. + /// + /// + /// The mixdown to evaluate. + /// + /// + /// The encoder to evaluate. + /// + /// + /// True if the encoder supports the mixdown. + /// + public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) + { + return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint) encoder.Id) > 0; + } + + /// + /// Determines if DRC can be applied to the given track with the given encoder. + /// + /// + /// The track to apply DRC to. + /// + /// + /// The encoder to use for DRC. + /// + /// + /// The title. + /// + /// + /// True if DRC can be applied to the track with the given encoder. + /// + 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; + } + + /// + /// Determines if the given input audio codec can be passed through. + /// + /// + /// The input codec to consider. + /// + /// + /// True if the codec can be passed through. + /// + public static bool CanPassthroughAudio(int codecId) + { + return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0; + } + + /// + /// Sanitizes a mixdown given the output codec and input channel layout. + /// + /// + /// The desired mixdown. + /// + /// + /// The output encoder to be used. + /// + /// + /// The input channel layout. + /// + /// + /// A sanitized mixdown value. + /// + 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); + } + + /// + /// Gets the default mixdown for the given audio encoder and channel layout. + /// + /// + /// The output codec to be used. + /// + /// + /// The input channel layout. + /// + /// + /// The default mixdown for the given codec and channel layout. + /// + 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); + } + + /// + /// Gets the bitrate limits for the given audio codec, sample rate and mixdown. + /// + /// + /// The audio encoder used. + /// + /// + /// The sample rate used (Hz). + /// + /// + /// The mixdown used. + /// + /// + /// Limits on the audio bitrate for the given settings. + /// + 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 }; + } + + /// + /// Gets the video quality limits for the given video codec. + /// + /// + /// The video encoder to check. + /// + /// + /// Limits on the video quality for the encoder. + /// + 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 + }; + } + + /// + /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown. + /// + /// + /// The desired audio bitrate. + /// + /// + /// The output encoder to be used. + /// + /// + /// The output sample rate to be used. + /// + /// + /// The mixdown to be used. + /// + /// + /// A sanitized audio bitrate. + /// + 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); + } + + /// + /// Gets the default audio bitrate for the given parameters. + /// + /// + /// The encoder to use. + /// + /// + /// The sample rate to use. + /// + /// + /// The mixdown to use. + /// + /// + /// The default bitrate for these parameters. + /// + public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) + { + return HBFunctions.hb_audio_bitrate_get_default((uint) encoder.Id, sampleRate, mixdown.Id); + } + + /// + /// Gets limits on audio quality for a given encoder. + /// + /// + /// The audio encoder ID. + /// + /// + /// Limits on the audio quality for the given encoder. + /// + 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 + }; + } + + /// + /// Gets limits on audio compression for a given encoder. + /// + /// + /// The audio encoder ID. + /// + /// + /// Limits on the audio compression for the given encoder. + /// + 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; /// - /// Contains utilities for converting language codes. - /// - public static class Languages - { - /// - /// The list of all languages. - /// - private static IList allLanguages; + /// Contains utilities for converting language codes. + /// + public static class Languages + { + /// + /// The list of all languages. + /// + private static IList allLanguages; - /// - /// Gets a list of all languages. - /// - public static IList AllLanguages - { - get - { - return allLanguages - ?? (allLanguages = + /// + /// Gets a list of all languages. + /// + public static IList AllLanguages + { + get + { + return allLanguages + ?? (allLanguages = InteropUtilities.ToListFromIterator(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); - } - } + } + } - /// - /// Gets the language object for the given code. - /// - /// The ISO-639-2 code for the language. - /// Object that describes the language. - public static Language Get(string code) - { - iso639_lang_t language = InteropUtilities.ToStructureFromPtr(HBFunctions.lang_for_code2(code)); + /// + /// Gets the language object for the given code. + /// + /// The ISO-639-2 code for the language. + /// Object that describes the language. + public static Language Get(string code) + { + iso639_lang_t language = InteropUtilities.ToStructureFromPtr(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; /// - /// Converters for various encoding values. - /// + /// Converters for various encoding values. + /// public static class HandBrakeUnitConversionHelpers - { - /// - /// Video Frame Rates - /// - private static readonly Dictionary VideoRates; + { + /// + /// Video Frame Rates + /// + private static readonly Dictionary VideoRates; - /// + /// /// Initializes static members of the HandBrakeUnitConversionHelpers class. - /// + /// static HandBrakeUnitConversionHelpers() - { - HandBrakeUtils.EnsureGlobalInit(); + { + HandBrakeUtils.EnsureGlobalInit(); - VideoRates = new Dictionary(); + VideoRates = new Dictionary(); foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates) - { - VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate); - } - } - - /// - /// Convert Framerate to Video Rates - /// - /// - /// The framerate. - /// - /// - /// The vrate if a valid framerate is passed in. - /// - /// - /// Thrown when framerate is invalid. - /// - public static int FramerateToVrate(double framerate) - { - if (!VideoRates.ContainsKey(framerate)) - { - throw new ArgumentException("Framerate not recognized.", "framerate"); - } - - return VideoRates[framerate]; - } - - /// - /// Converts a native HB encoder structure to an Encoder model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder) - { - return new HBVideoEncoder - { - Id = encoder.codec, - ShortName = encoder.short_name, - DisplayName = encoder.name, - CompatibleContainers = encoder.muxers - }; - } - - /// - /// Converts a native HB encoder structure to an Encoder model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - 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); + } + } + + /// + /// Convert Framerate to Video Rates + /// + /// + /// The framerate. + /// + /// + /// The vrate if a valid framerate is passed in. + /// + /// + /// Thrown when framerate is invalid. + /// + public static int FramerateToVrate(double framerate) + { + if (!VideoRates.ContainsKey(framerate)) + { + throw new ArgumentException("Framerate not recognized.", "framerate"); + } + + return VideoRates[framerate]; + } + + /// + /// Converts a native HB encoder structure to an Encoder model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder) + { + return new HBVideoEncoder + { + Id = encoder.codec, + ShortName = encoder.short_name, + DisplayName = encoder.name, + CompatibleContainers = encoder.muxers + }; + } + + /// + /// Converts a native HB encoder structure to an Encoder model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + 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; - } - - /// - /// Converts a native HB rate structure to an HBRate object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted rate object. - /// - public static HBRate NativeToRate(hb_rate_s rate) - { - return new HBRate - { - Name = rate.name, - Rate = rate.rate - }; - } - - /// - /// Converts a native HB mixdown structure to a Mixdown model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown) - { - return new HBMixdown - { - Id = mixdown.amixdown, - ShortName = mixdown.short_name, - DisplayName = mixdown.name - }; - } - - /// - /// Converts a native HB container structure into an HBContainer object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted structure. - /// - 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 - }; - } - - /// - /// Converts a native language structure to a Language object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted structure. - /// - 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 - }; - } - - /// - /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here. - /// - /// - /// The PTS to convert. - /// - /// - /// The timespan for it. - /// - public static TimeSpan PtsToTimeSpan(ulong pts) - { - return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); - } - - /// - /// Converts the PTS amount to seconds. - /// - /// - /// The PTS to convert. - /// - /// - /// The corresponding number of seconds. - /// - 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; + } + + /// + /// Converts a native HB rate structure to an HBRate object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted rate object. + /// + public static HBRate NativeToRate(hb_rate_s rate) + { + return new HBRate + { + Name = rate.name, + Rate = rate.rate + }; + } + + /// + /// Converts a native HB mixdown structure to a Mixdown model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown) + { + return new HBMixdown + { + Id = mixdown.amixdown, + ShortName = mixdown.short_name, + DisplayName = mixdown.name + }; + } + + /// + /// Converts a native HB container structure into an HBContainer object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted structure. + /// + 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 + }; + } + + /// + /// Converts a native language structure to a Language object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted structure. + /// + 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 + }; + } + + /// + /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here. + /// + /// + /// The PTS to convert. + /// + /// + /// The timespan for it. + /// + public static TimeSpan PtsToTimeSpan(ulong pts) + { + return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); + } + + /// + /// Converts the PTS amount to seconds. + /// + /// + /// The PTS to convert. + /// + /// + /// The corresponding number of seconds. + /// + 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; - /// - /// Contains p-invoke function declarations to hblib. - /// - public static class HBFunctions - { - [DllImport("hb.dll", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_register_logger(LoggingCallback callback); + /// + /// Contains p-invoke function declarations to hblib. + /// + 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. /// 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; /// - /// Helper utilities for native interop. - /// - internal static class InteropUtilities - { - /// - /// Reads the given native structure pointer. - /// - /// The type to convert the structure to. - /// The pointer to the native structure. - /// The converted structure. - public static T ToStructureFromPtr(IntPtr structPtr) - { - return (T)Marshal.PtrToStructure(structPtr, typeof(T)); - } - - /// - /// Reads the given native UTF-8 string. - /// - /// The pointer to the string. - /// The resulting string. - public static string ToStringFromUtf8Ptr(IntPtr stringPtr) - { - var data = new List(); - 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()); - } - - /// - /// Creates a pointer to a UTF-8 null-terminated string. - /// - /// - /// The string to encode. - /// - /// - /// The . - /// - 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; - } - - /// - /// Converts the given native HandBrake list to a managed list. - /// - /// The type of structure in the list. - /// The pointer to the native list. - /// The converted managed list. - public static List ToListFromHandBrakeList(this IntPtr listPtr) - { - List returnList = new List(); - NativeList nativeList = new NativeList(listPtr); - - for (int i = 0; i < nativeList.Count; i++) - { - IntPtr itemPtr = nativeList[i]; - returnList.Add(ToStructureFromPtr(itemPtr)); - } - - return returnList; - } - - /// - /// Converts the HB list to a managed list of pointers. - /// - /// The list to convert. - /// The managed list of pointers. - public static List ToIntPtrList(this IntPtr listPtr) - { - var returnList = new List(); - NativeList nativeList = new NativeList(listPtr); - - for (int i = 0; i < nativeList.Count; i++) - { - IntPtr itemPtr = nativeList[i]; - returnList.Add(itemPtr); - } - - return returnList; - } - - /// - /// Converts the given native array to a managed collection. - /// - /// The type of item in the list. - /// The pointer to the array. - /// The number of items in the array. - /// The converted collection. - public static List ToListFromNativeArray(IntPtr arrayPtr, int count) - { - IntPtr currentItem = arrayPtr; - - var result = new List(); - for (int i = 0; i < count; i++) - { - T nativeEncoder = ToStructureFromPtr(currentItem); - result.Add(nativeEncoder); - - currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T))); - } - - return result; - } - - /// - /// Takes an array pointer and converts it into a list of strings. - /// - /// A pointer to a raw list of strings. - /// The list of strings. - public static List ToStringListFromArrayPtr(IntPtr arrayPtr) - { - if (arrayPtr == IntPtr.Zero) - { - return null; - } - - return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList(); - } - - /// - /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer. - /// - /// The address of the list of pointers. - /// The list of pointers. - public static List ToPtrListFromPtr(IntPtr arrayPtr) - { - var result = new List(); - 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; - } - - /// - /// Creates a native HandBrake list from the given managed list of pointers. - /// - /// The managed list to convert. - /// The converted native list. - public static NativeList ToHandBrakeListFromPtrList(List list) - { - NativeList returnList = NativeList.CreateList(); - - foreach (IntPtr ptr in list) - { - returnList.Add(ptr); - } - - return returnList; - } - - /// - /// Creates a native HandBrake list from the given managed list of structures. - /// - /// The type of structures in the list. - /// The managed list to convert. - /// The converted native list. - public static NativeList ToHandBrakeListFromList(List 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; - } - - /// - /// Reads in a list of objects given an interator and a conversion function. - /// - /// The type of the struct given by the iterator. - /// The object type to convert to. - /// The iterator to use to build the list. - /// The converter to convert from the struct to the object. - /// The list of objects. - public static List ToListFromIterator(Func iterator, Func converter) - { - return ToListFromIterator(iterator).Select(converter).ToList(); - } - - /// - /// Reads in a list of structs given an iterator. - /// - /// The type of the struct. - /// The iterator to use to build the list. - /// The list of structs. - public static List ToListFromIterator(Func iterator) - { - var structureList = new List(); - IntPtr current = IntPtr.Zero; - - current = iterator(current); - while (current != IntPtr.Zero) - { - T encoder = ToStructureFromPtr(current); - structureList.Add(encoder); - - current = iterator(current); - } - - return structureList; - } - - /// - /// Closes the given job. - /// - /// The pointer to the job. - 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); - } - - /// - /// Frees all the memory locations in the given list. - /// - /// The list of memory locations to free. - public static void FreeMemory(List memoryList) - { - foreach (IntPtr memoryLocation in memoryList) - { - Marshal.FreeHGlobal(memoryLocation); - } - } - } + /// Helper utilities for native interop. + /// + internal static class InteropUtilities + { + /// + /// Reads the given native structure pointer. + /// + /// The type to convert the structure to. + /// The pointer to the native structure. + /// The converted structure. + public static T ToStructureFromPtr(IntPtr structPtr) + { + return (T)Marshal.PtrToStructure(structPtr, typeof(T)); + } + + /// + /// Reads the given native UTF-8 string. + /// + /// The pointer to the string. + /// The resulting string. + public static string ToStringFromUtf8Ptr(IntPtr stringPtr) + { + var data = new List(); + 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()); + } + + /// + /// Creates a pointer to a UTF-8 null-terminated string. + /// + /// + /// The string to encode. + /// + /// + /// The . + /// + 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; + } + + /// + /// Converts the given native HandBrake list to a managed list. + /// + /// The type of structure in the list. + /// The pointer to the native list. + /// The converted managed list. + public static List ToListFromHandBrakeList(this IntPtr listPtr) + { + List returnList = new List(); + NativeList nativeList = new NativeList(listPtr); + + for (int i = 0; i < nativeList.Count; i++) + { + IntPtr itemPtr = nativeList[i]; + returnList.Add(ToStructureFromPtr(itemPtr)); + } + + return returnList; + } + + /// + /// Converts the HB list to a managed list of pointers. + /// + /// The list to convert. + /// The managed list of pointers. + public static List ToIntPtrList(this IntPtr listPtr) + { + var returnList = new List(); + NativeList nativeList = new NativeList(listPtr); + + for (int i = 0; i < nativeList.Count; i++) + { + IntPtr itemPtr = nativeList[i]; + returnList.Add(itemPtr); + } + + return returnList; + } + + /// + /// Converts the given native array to a managed collection. + /// + /// The type of item in the list. + /// The pointer to the array. + /// The number of items in the array. + /// The converted collection. + public static List ToListFromNativeArray(IntPtr arrayPtr, int count) + { + IntPtr currentItem = arrayPtr; + + var result = new List(); + for (int i = 0; i < count; i++) + { + T nativeEncoder = ToStructureFromPtr(currentItem); + result.Add(nativeEncoder); + + currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T))); + } + + return result; + } + + /// + /// Takes an array pointer and converts it into a list of strings. + /// + /// A pointer to a raw list of strings. + /// The list of strings. + public static List ToStringListFromArrayPtr(IntPtr arrayPtr) + { + if (arrayPtr == IntPtr.Zero) + { + return null; + } + + return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList(); + } + + /// + /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer. + /// + /// The address of the list of pointers. + /// The list of pointers. + public static List ToPtrListFromPtr(IntPtr arrayPtr) + { + var result = new List(); + 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; + } + + /// + /// Creates a native HandBrake list from the given managed list of pointers. + /// + /// The managed list to convert. + /// The converted native list. + public static NativeList ToHandBrakeListFromPtrList(List list) + { + NativeList returnList = NativeList.CreateList(); + + foreach (IntPtr ptr in list) + { + returnList.Add(ptr); + } + + return returnList; + } + + /// + /// Creates a native HandBrake list from the given managed list of structures. + /// + /// The type of structures in the list. + /// The managed list to convert. + /// The converted native list. + public static NativeList ToHandBrakeListFromList(List 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; + } + + /// + /// Reads in a list of objects given an interator and a conversion function. + /// + /// The type of the struct given by the iterator. + /// The object type to convert to. + /// The iterator to use to build the list. + /// The converter to convert from the struct to the object. + /// The list of objects. + public static List ToListFromIterator(Func iterator, Func converter) + { + return ToListFromIterator(iterator).Select(converter).ToList(); + } + + /// + /// Reads in a list of structs given an iterator. + /// + /// The type of the struct. + /// The iterator to use to build the list. + /// The list of structs. + public static List ToListFromIterator(Func iterator) + { + var structureList = new List(); + IntPtr current = IntPtr.Zero; + + current = iterator(current); + while (current != IntPtr.Zero) + { + T encoder = ToStructureFromPtr(current); + structureList.Add(encoder); + + current = iterator(current); + } + + return structureList; + } + + /// + /// Closes the given job. + /// + /// The pointer to the job. + 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); + } + + /// + /// Frees all the memory locations in the given list. + /// + /// The list of memory locations to free. + public static void FreeMemory(List 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; /// - /// Represents a HandBrake style native list. - /// - internal class NativeList : IDisposable - { - /// - /// Initializes a new instance of the NativeList class. - /// - /// The pointer to use for the list. - public NativeList(IntPtr listPtr) - { - this.Ptr = listPtr; - } + /// Represents a HandBrake style native list. + /// + internal class NativeList : IDisposable + { + /// + /// Initializes a new instance of the NativeList class. + /// + /// The pointer to use for the list. + public NativeList(IntPtr listPtr) + { + this.Ptr = listPtr; + } - /// - /// The list of native memory locations allocated for this list. - /// - private readonly List allocatedMemory = new List(); + /// + /// The list of native memory locations allocated for this list. + /// + private readonly List allocatedMemory = new List(); - /// - /// Gets the pointer to the native list. - /// - public IntPtr Ptr { get; private set; } + /// + /// Gets the pointer to the native list. + /// + public IntPtr Ptr { get; private set; } - /// - /// Gets the number of items in the list. - /// - public int Count - { - get + /// + /// Gets the number of items in the list. + /// + 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); - } - } + } + } - /// - /// Gets the list of native memory locations allocated for this list. - /// - public List AllocatedMemory - { - get - { - return this.allocatedMemory; - } - } + /// + /// Gets the list of native memory locations allocated for this list. + /// + public List AllocatedMemory + { + get + { + return this.allocatedMemory; + } + } - /// - /// Adds an item to the end of the list. - /// - /// The item to add. - public void Add(IntPtr item) - { - HBFunctions.hb_list_add(this.Ptr, item); - } + /// + /// Adds an item to the end of the list. + /// + /// The item to add. + public void Add(IntPtr item) + { + HBFunctions.hb_list_add(this.Ptr, item); + } - /// - /// Inserts an item into the list. - /// - /// The index to insert the item at. - /// The item to insert. - public void Insert(int position, IntPtr item) - { - HBFunctions.hb_list_insert(this.Ptr, position, item); - } + /// + /// Inserts an item into the list. + /// + /// The index to insert the item at. + /// The item to insert. + public void Insert(int position, IntPtr item) + { + HBFunctions.hb_list_insert(this.Ptr, position, item); + } - /// - /// Removes an item from the list. - /// - /// The item to remove. - public void Remove(IntPtr item) - { - HBFunctions.hb_list_rem(this.Ptr, item); - } + /// + /// Removes an item from the list. + /// + /// The item to remove. + public void Remove(IntPtr item) + { + HBFunctions.hb_list_rem(this.Ptr, item); + } - /// - /// Gets an item out of the list. - /// - /// Index in the list. - /// The item at that index in the list. - public IntPtr this[int i] - { - get - { - return HBFunctions.hb_list_item(this.Ptr, i); - } - } + /// + /// Gets an item out of the list. + /// + /// Index in the list. + /// The item at that index in the list. + public IntPtr this[int i] + { + get + { + return HBFunctions.hb_list_item(this.Ptr, i); + } + } - /// - /// Disposes resources associated with this object. - /// - public void Dispose() - { - IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); - Marshal.WriteIntPtr(listPtrPtr, this.Ptr); - HBFunctions.hb_list_close(listPtrPtr); - Marshal.FreeHGlobal(listPtrPtr); - } + /// + /// Disposes resources associated with this object. + /// + public void Dispose() + { + IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); + Marshal.WriteIntPtr(listPtrPtr, this.Ptr); + HBFunctions.hb_list_close(listPtrPtr); + Marshal.FreeHGlobal(listPtrPtr); + } - /// - /// Creates a new list in unmanaged memory. - /// - /// The created list. - public static NativeList CreateList() - { - return new NativeList(HBFunctions.hb_list_init()); - } - } + /// + /// Creates a new list in unmanaged memory. + /// + /// The created list. + 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. /// internal static class Utilities - { + { /// /// Get the Greatest Common Factor /// @@ -27,23 +27,23 @@ namespace HandBrake.ApplicationServices.Interop.Helpers /// The greatest common factor /// 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 { - /// - /// Represents bitrate limits as a range. - /// - public class BitrateLimits - { - /// - /// The inclusive lower limit for the bitrate. - /// - public int Low { get; set; } + /// + /// Represents bitrate limits as a range. + /// + public class BitrateLimits + { + /// + /// The inclusive lower limit for the bitrate. + /// + public int Low { get; set; } - /// - /// The inclusive upper limit for the bitrate. - /// - public int High { get; set; } - } + /// + /// The inclusive upper limit for the bitrate. + /// + 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 /// public class Cropping - { + { /// /// Initializes a new instance of the class. /// @@ -86,14 +86,14 @@ namespace HandBrake.ApplicationServices.Interop.Model /// A Cloned copy /// 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; /// - /// The encode job. - /// - public class EncodeJob - { - /// - /// Initializes a new instance of the class. - /// - public EncodeJob() - { + /// The encode job. + /// + public class EncodeJob + { + /// + /// Initializes a new instance of the class. + /// + public EncodeJob() + { this.Cropping = new Cropping(); - } + } #region Source @@ -415,30 +415,30 @@ namespace HandBrake.ApplicationServices.Interop.Model #region Public Methods /// - /// The clone. - /// - /// - /// The . - /// - 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. + /// + /// + /// The . + /// + 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(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; /// /// The anamorphic. /// 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. /// 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; - /// - /// The Audio Encoding Model - /// - public class AudioEncoding - { - /// - /// Initializes a new instance of the AudioEncoding class. - /// - public AudioEncoding() - { - // Initialize to -1 to differentiate a compression of 0 from uninitialized. - this.Compression = -1; - } + /// + /// The Audio Encoding Model + /// + public class AudioEncoding + { + /// + /// Initializes a new instance of the AudioEncoding class. + /// + public AudioEncoding() + { + // Initialize to -1 to differentiate a compression of 0 from uninitialized. + this.Compression = -1; + } - /// - /// Gets or sets the chosen track to apply the encoding to. - /// - /// 1-based index. 0 means apply to all tracks. - public int InputNumber { get; set; } + /// + /// Gets or sets the chosen track to apply the encoding to. + /// + /// 1-based index. 0 means apply to all tracks. + public int InputNumber { get; set; } - /// - /// Gets or sets the encoder to use. - /// - public string Encoder { get; set; } + /// + /// Gets or sets the encoder to use. + /// + public string Encoder { get; set; } - /// - /// Gets or sets the encode rate type (bitrate or quality). - /// - public AudioEncodeRateType EncodeRateType { get; set; } + /// + /// Gets or sets the encode rate type (bitrate or quality). + /// + public AudioEncodeRateType EncodeRateType { get; set; } - /// - /// Gets or sets the bitrate (in kbps) of this track. - /// - public int Bitrate { get; set; } + /// + /// Gets or sets the bitrate (in kbps) of this track. + /// + public int Bitrate { get; set; } - /// - /// Gets or sets the target audio quality for this track. - /// - public float Quality { get; set; } + /// + /// Gets or sets the target audio quality for this track. + /// + public float Quality { get; set; } - /// - /// Gets or sets the target audio compression for this track. - /// - public float Compression { get; set; } + /// + /// Gets or sets the target audio compression for this track. + /// + public float Compression { get; set; } - /// - /// Gets or sets the mixdown. - /// - public string Mixdown { get; set; } + /// + /// Gets or sets the mixdown. + /// + public string Mixdown { get; set; } - /// - /// Gets or sets the sample rate in Hz. - /// - public int SampleRateRaw { get; set; } + /// + /// Gets or sets the sample rate in Hz. + /// + public int SampleRateRaw { get; set; } - /// - /// Gets or sets Gain. - /// - public int Gain { get; set; } + /// + /// Gets or sets Gain. + /// + public int Gain { get; set; } - /// - /// Gets or sets Drc. - /// - public double Drc { get; set; } + /// + /// Gets or sets Drc. + /// + public double Drc { get; set; } - /// - /// Gets or sets Name. - /// - public string Name { get; set; } + /// + /// Gets or sets Name. + /// + public string Name { get; set; } - /// - /// Gets or sets a value indicating whether is passthru. - /// - public bool IsPassthru { get; set; } - } + /// + /// Gets or sets a value indicating whether is passthru. + /// + 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; /// /// The container. /// [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. /// 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. /// 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. /// 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. /// 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 { - /// - /// Represents a rate in HandBrake: audio sample rate or video framerate. - /// - public class HBRate - { - /// - /// Gets or sets the name to use for this rate. - /// - public string Name { get; set; } + /// + /// Represents a rate in HandBrake: audio sample rate or video framerate. + /// + public class HBRate + { + /// + /// Gets or sets the name to use for this rate. + /// + public string Name { get; set; } - /// - /// Gets or sets the raw rate. - /// - public int Rate { get; set; } - } + /// + /// Gets or sets the raw rate. + /// + 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; - /// + /// /// The hb video encoder. /// public class HBVideoEncoder @@ -39,48 +39,48 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding /// public string ShortName { get; set; } - /// - /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets) - /// - public List Presets - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id)); - } - } + /// + /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets) + /// + public List Presets + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id)); + } + } - /// - /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes) - /// - public List Tunes - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id)); - } - } + /// + /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes) + /// + public List Tunes + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id)); + } + } - /// - /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles) - /// - public List Profiles - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id)); - } - } + /// + /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles) + /// + public List Profiles + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id)); + } + } - /// - /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels) - /// - public List Levels - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id)); - } - } + /// + /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels) + /// + public List 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; - /// - /// The Audio Mixdown Enumeration - /// - public enum Mixdown - { - [Display(Name = "Dolby Pro Logic II")] - DolbyProLogicII = 0, + /// + /// The Audio Mixdown Enumeration + /// + 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. /// 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 { - /// - /// Possible picture rotations. - /// - public enum PictureRotation - { - None = 0, - Clockwise90, - Clockwise180, - Clockwise270 - } + /// + /// Possible picture rotations. + /// + 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 { - /// - /// Enumeration of rescaling algorithms. - /// - public enum ScaleMethod - { - /// - /// Standard software scaling. Highest quality. - /// - Lanczos = 0, + /// + /// Enumeration of rescaling algorithms. + /// + public enum ScaleMethod + { + /// + /// Standard software scaling. Highest quality. + /// + Lanczos = 0, - /// - /// OpenCL-assisted bicubic scaling. - /// - Bicubic = 1 - } + /// + /// OpenCL-assisted bicubic scaling. + /// + 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. /// 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; /// /// The video encoder. /// 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 { - /// - /// Represents a language. - /// - public class Language - { - /// - /// Gets or sets the english name of the language. - /// - public string EnglishName { get; set; } + /// + /// Represents a language. + /// + public class Language + { + /// + /// Gets or sets the english name of the language. + /// + public string EnglishName { get; set; } - /// - /// Gets or sets the native name of the language. - /// - public string NativeName { get; set; } + /// + /// Gets or sets the native name of the language. + /// + public string NativeName { get; set; } - /// - /// Gets or sets the language code. - /// - public string Code { get; set; } + /// + /// Gets or sets the language code. + /// + public string Code { get; set; } - /// - /// Gets the display string for the language. - /// - public string Display - { - get - { - if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName) - { - return this.EnglishName + " (" + this.NativeName + ")"; - } + /// + /// Gets the display string for the language. + /// + 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 { /// - /// An object represending an AudioTrack associated with a Title, in a DVD - /// - public class AudioTrack - { - /// - /// Gets or sets the track number of this Audio Track - /// - public int TrackNumber { get; set; } + /// An object represending an AudioTrack associated with a Title, in a DVD + /// + public class AudioTrack + { + /// + /// Gets or sets the track number of this Audio Track + /// + public int TrackNumber { get; set; } - /// - /// Gets or sets the audio codec ID for this track. - /// - public uint CodecId { get; set; } + /// + /// Gets or sets the audio codec ID for this track. + /// + public uint CodecId { get; set; } - /// - /// Gets or sets the language (if detected) of this Audio Track - /// - public string Language { get; set; } + /// + /// Gets or sets the language (if detected) of this Audio Track + /// + public string Language { get; set; } - /// - /// Gets or sets the language code for this audio track. - /// - public string LanguageCode { get; set; } + /// + /// Gets or sets the language code for this audio track. + /// + public string LanguageCode { get; set; } - /// - /// Gets or sets the description for this audio track. - /// - public string Description { get; set; } + /// + /// Gets or sets the description for this audio track. + /// + public string Description { get; set; } - /// - /// Gets or sets the channel layout of this Audio Track. - /// - public ulong ChannelLayout { get; set; } + /// + /// Gets or sets the channel layout of this Audio Track. + /// + public ulong ChannelLayout { get; set; } - /// - /// Gets or sets the frequency (in Hz) of this Audio Track - /// - public int SampleRate { get; set; } + /// + /// Gets or sets the frequency (in Hz) of this Audio Track + /// + public int SampleRate { get; set; } - /// - /// Gets or sets the bitrate (in bits/sec) of this Audio Track. - /// - public int Bitrate { get; set; } + /// + /// Gets or sets the bitrate (in bits/sec) of this Audio Track. + /// + public int Bitrate { get; set; } - /// - /// Gets the display string for this audio track. - /// - public string Display - { - get - { - return this.GetDisplayString(true); - } - } + /// + /// Gets the display string for this audio track. + /// + public string Display + { + get + { + return this.GetDisplayString(true); + } + } - /// - /// Gets the display string for this audio track (not including track number) - /// - public string NoTrackDisplay - { - get - { - return this.GetDisplayString(false); - } - } + /// + /// Gets the display string for this audio track (not including track number) + /// + public string NoTrackDisplay + { + get + { + return this.GetDisplayString(false); + } + } - /// - /// Override of the ToString method to make this object easier to use in the UI - /// - /// A string formatted as: {track #} {language} ({format}) ({sub-format}) - public override string ToString() - { - return this.GetDisplayString(true); - } + /// + /// Override of the ToString method to make this object easier to use in the UI + /// + /// A string formatted as: {track #} {language} ({format}) ({sub-format}) + public override string ToString() + { + return this.GetDisplayString(true); + } - /// - /// The get display string. - /// - /// - /// The include track number. - /// - /// - /// The . - /// - private string GetDisplayString(bool includeTrackNumber) - { - if (includeTrackNumber) - { - return this.TrackNumber + " " + this.Description; - } - + /// + /// The get display string. + /// + /// + /// The include track number. + /// + /// + /// The . + /// + 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; /// - /// An object representing a Chapter aosciated with a Title, in a DVD - /// - public class Chapter - { + /// An object representing a Chapter aosciated with a Title, in a DVD + /// + public class Chapter + { /// /// Gets or sets the name. /// public string Name { get; set; } - /// - /// Gets or sets the number of this Chapter, in regards to its parent Title - /// - public int ChapterNumber { get; set; } + /// + /// Gets or sets the number of this Chapter, in regards to its parent Title + /// + public int ChapterNumber { get; set; } - /// - /// Gets or sets the duration of this chapter. - /// - public TimeSpan Duration { get; set; } + /// + /// Gets or sets the duration of this chapter. + /// + public TimeSpan Duration { get; set; } - /// - /// Override of the ToString method to make this object easier to use in the UI - /// - /// A string formatted as: {chapter #} - public override string ToString() - { - return this.ChapterNumber.ToString(CultureInfo.InvariantCulture); - } - } + /// + /// Override of the ToString method to make this object easier to use in the UI + /// + /// A string formatted as: {chapter #} + 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. /// 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; /// - /// An object that represents a subtitle associated with a Title, in a DVD - /// - public class Subtitle - { - /// - /// Gets or sets the track number of this Subtitle - /// - public int TrackNumber { get; set; } + /// An object that represents a subtitle associated with a Title, in a DVD + /// + public class Subtitle + { + /// + /// Gets or sets the track number of this Subtitle + /// + public int TrackNumber { get; set; } - /// - /// Gets or sets the language (if detected) of this Subtitle - /// - public string Language { get; set; } + /// + /// Gets or sets the language (if detected) of this Subtitle + /// + public string Language { get; set; } - /// - /// Gets or sets the Langauage Code. - /// - public string LanguageCode { get; set; } + /// + /// Gets or sets the Langauage Code. + /// + public string LanguageCode { get; set; } - /// - /// Gets or sets the subtitle source. - /// - public SubtitleSource SubtitleSource { get; set; } + /// + /// Gets or sets the subtitle source. + /// + public SubtitleSource SubtitleSource { get; set; } - /// - /// Gets or sets the subtitle source raw integer. - /// - public int SubtitleSourceInt { get; set; } + /// + /// Gets or sets the subtitle source raw integer. + /// + public int SubtitleSourceInt { get; set; } - /// - /// Gets a value indicating whether the "forced only" flag can be set on this subtitle. - /// - public bool CanSetForcedOnly - { - get - { - return HBFunctions.hb_subtitle_can_force(this.SubtitleSourceInt) > 0; - } - } + /// + /// Gets a value indicating whether the "forced only" flag can be set on this subtitle. + /// + public bool CanSetForcedOnly + { + get + { + return HBFunctions.hb_subtitle_can_force(this.SubtitleSourceInt) > 0; + } + } - /// - /// Gets a value indicating whether this subtitle can be burned into the picture. - /// - public bool CanBurn - { - get - { - return HBFunctions.hb_subtitle_can_burn(this.SubtitleSourceInt) > 0; - } - } + /// + /// Gets a value indicating whether this subtitle can be burned into the picture. + /// + public bool CanBurn + { + get + { + return HBFunctions.hb_subtitle_can_burn(this.SubtitleSourceInt) > 0; + } + } - /// - /// Returns true if the subtitle can be passed through using the given muxer. - /// - /// The muxer ID. - /// True if the subtitle can be passed through. - public bool CanPass(int muxer) - { - return HBFunctions.hb_subtitle_can_pass(this.SubtitleSourceInt, muxer) > 0; - } + /// + /// Returns true if the subtitle can be passed through using the given muxer. + /// + /// The muxer ID. + /// True if the subtitle can be passed through. + public bool CanPass(int muxer) + { + return HBFunctions.hb_subtitle_can_pass(this.SubtitleSourceInt, muxer) > 0; + } - /// - /// Override of the ToString method to make this object easier to use in the UI - /// - /// A string formatted as: {track #} {language} - public override string ToString() - { - return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource); - } + /// + /// Override of the ToString method to make this object easier to use in the UI + /// + /// A string formatted as: {track #} {language} + public override string ToString() + { + return string.Format("{0} {1} ({2})", this.TrackNumber, this.Language, this.SubtitleSource); + } - /// - /// Gets the display. - /// - public string Display - { - get - { - return this.ToString(); - } - } - } + /// + /// Gets the display. + /// + 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. /// 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; /// - /// An object that represents a single Title of a DVD - /// - public class Title - { - /// - /// The audio tracks. - /// - private readonly List audioTracks; - - /// - /// The chapters. - /// - private readonly List chapters; - - /// - /// The subtitles. - /// - private readonly List subtitles; - - /// - /// Initializes a new instance of the Title class. - /// - public Title() - { - this.audioTracks = new List(); - this.chapters = new List(); - this.subtitles = new List(); - } - - /// - /// Gets or sets the input type of this title. - /// - public InputType InputType { get; set; } - - /// - /// Gets a collection of chapters in this Title - /// - public List Chapters - { - get { return this.chapters; } - } - - /// - /// Gets a collection of audio tracks associated with this Title - /// - public List AudioTracks - { - get { return this.audioTracks; } - } - - /// - /// Gets a collection of subtitles associated with this Title - /// - public List Subtitles - { - get { return this.subtitles; } - } - - /// - /// Gets or sets the track number of this Title (1-based). - /// - public int TitleNumber { get; set; } - - /// - /// Gets or sets the playlist number this title came from. - /// - public int Playlist { get; set; } - - /// - /// Gets or sets the duration of this title. - /// - public TimeSpan Duration { get; set; } - - /// - /// Gets or sets the resolution (width/height) of this Title - /// - public Size Resolution { get; set; } - - /// - /// Gets or sets the number of angles on the title. - /// - public int AngleCount { get; set; } - - /// - /// Gets or sets the pixel aspect ratio. - /// - public Size ParVal { get; set; } - - /// - /// Gets or sets the automatically detected crop region for this Title. - /// - public Cropping AutoCropDimensions { get; set; } - - /// - /// Gets or sets the name of the video codec for this title. - /// - public string VideoCodecName { get; set; } - - /// - /// Gets or sets the video frame rate for this title. - /// - public double Framerate { get; set; } - - /// - /// Gets or sets the video frame rate numerator. - /// - public int FramerateNumerator { get; set; } - - /// - /// Gets or sets the video frame rate denominator. - /// - public int FramerateDenominator { get; set; } - - /// - /// Gets the total number of frames in this title. - /// - public int Frames - { - get - { - return (int)Math.Ceiling(this.Duration.TotalSeconds * this.Framerate); - } - } - - /// - /// Gets or sets the path. - /// - public string Path { get; set; } - - /// - /// Override of the ToString method to provide an easy way to use this object in the UI - /// - /// A string representing this track in the format: {title #}[ {playlist source}] (00:00:00) - 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); - } - - /// - /// Gets the display string for this title. - /// - public string Display - { - get - { - return this.ToString(); - } - } + /// An object that represents a single Title of a DVD + /// + public class Title + { + /// + /// The audio tracks. + /// + private readonly List audioTracks; + + /// + /// The chapters. + /// + private readonly List chapters; + + /// + /// The subtitles. + /// + private readonly List subtitles; + + /// + /// Initializes a new instance of the Title class. + /// + public Title() + { + this.audioTracks = new List(); + this.chapters = new List(); + this.subtitles = new List(); + } + + /// + /// Gets or sets the input type of this title. + /// + public InputType InputType { get; set; } + + /// + /// Gets a collection of chapters in this Title + /// + public List Chapters + { + get { return this.chapters; } + } + + /// + /// Gets a collection of audio tracks associated with this Title + /// + public List AudioTracks + { + get { return this.audioTracks; } + } + + /// + /// Gets a collection of subtitles associated with this Title + /// + public List Subtitles + { + get { return this.subtitles; } + } + + /// + /// Gets or sets the track number of this Title (1-based). + /// + public int TitleNumber { get; set; } + + /// + /// Gets or sets the playlist number this title came from. + /// + public int Playlist { get; set; } + + /// + /// Gets or sets the duration of this title. + /// + public TimeSpan Duration { get; set; } + + /// + /// Gets or sets the resolution (width/height) of this Title + /// + public Size Resolution { get; set; } + + /// + /// Gets or sets the number of angles on the title. + /// + public int AngleCount { get; set; } + + /// + /// Gets or sets the pixel aspect ratio. + /// + public Size ParVal { get; set; } + + /// + /// Gets or sets the automatically detected crop region for this Title. + /// + public Cropping AutoCropDimensions { get; set; } + + /// + /// Gets or sets the name of the video codec for this title. + /// + public string VideoCodecName { get; set; } + + /// + /// Gets or sets the video frame rate for this title. + /// + public double Framerate { get; set; } + + /// + /// Gets or sets the video frame rate numerator. + /// + public int FramerateNumerator { get; set; } + + /// + /// Gets or sets the video frame rate denominator. + /// + public int FramerateDenominator { get; set; } + + /// + /// Gets the total number of frames in this title. + /// + public int Frames + { + get + { + return (int)Math.Ceiling(this.Duration.TotalSeconds * this.Framerate); + } + } + + /// + /// Gets or sets the path. + /// + public string Path { get; set; } + + /// + /// Override of the ToString method to provide an easy way to use this object in the UI + /// + /// A string representing this track in the format: {title #}[ {playlist source}] (00:00:00) + 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); + } + + /// + /// Gets the display string for this title. + /// + public string Display + { + get + { + return this.ToString(); + } + } /// /// Gets or sets a value indicating whether is main feature. /// 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 /// public bool Default { get; set; } - /// - /// Gets or sets a value indicating whether the subtitle track should be burned in. - /// - public bool BurnedIn { get; set; } + /// + /// Gets or sets a value indicating whether the subtitle track should be burned in. + /// + public bool BurnedIn { get; set; } /// /// 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 { - /// - /// Represents limits on video quality for a particular encoder. - /// - public class VideoQualityLimits - { - /// - /// Gets or sets the inclusive lower limit for the quality. - /// - public float Low { get; set; } + /// + /// Represents limits on video quality for a particular encoder. + /// + public class VideoQualityLimits + { + /// + /// Gets or sets the inclusive lower limit for the quality. + /// + public float Low { get; set; } - /// - /// Gets or sets the inclusive upper limit for the quality. - /// - public float High { get; set; } + /// + /// Gets or sets the inclusive upper limit for the quality. + /// + public float High { get; set; } - /// - /// Gets or sets the granularity for the quality. - /// - public float Granularity { get; set; } + /// + /// Gets or sets the granularity for the quality. + /// + public float Granularity { get; set; } - /// - /// Gets or sets a value indicating whether the quality increases as the number increases. - /// - public bool Ascending { get; set; } - } + /// + /// Gets or sets a value indicating whether the quality increases as the number increases. + /// + 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; - /// - /// The video range type. - /// - public enum VideoRangeType - { - /// - /// The entire title. - /// - [Display(Name = "Preview")] - Preview, + /// + /// The video range type. + /// + public enum VideoRangeType + { + /// + /// The entire title. + /// + [Display(Name = "Preview")] + Preview, - /// - /// A chapter range. - /// - [Display(Name = "Chapters")] - Chapters, + /// + /// A chapter range. + /// + [Display(Name = "Chapters")] + Chapters, - /// - /// A timespan range in seconds. - /// - [Display(Name = "Seconds")] - Seconds, + /// + /// A timespan range in seconds. + /// + [Display(Name = "Seconds")] + Seconds, - /// - /// A frame range. - /// - [Display(Name = "Frames")] - Frames - } + /// + /// A frame range. + /// + [Display(Name = "Frames")] + Frames + } } \ No newline at end of file