diff options
author | sr55 <[email protected]> | 2015-06-20 19:45:31 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-06-20 19:45:31 +0000 |
commit | ae9dbce961c2d87e5f52288c35fbf882de8430c7 (patch) | |
tree | c8da7e616457a9fa67505de26ad3dfffcdb8dc8f /win/CS/HandBrake.ApplicationServices/Interop | |
parent | 9192276e8bfde8ac2ce798edf677be141ad5e9b5 (diff) |
WinGui: Initial implementation of quality based encoding option. Please note, the preset version has been bumped so user presets will need to be re-created.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7306 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Interop')
3 files changed, 67 insertions, 112 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs index 524b6b0ad..cddfd3634 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs @@ -9,7 +9,6 @@ namespace HandBrake.ApplicationServices.Interop
{
- using System;
using System.Collections.Generic;
using System.Linq;
@@ -45,7 +44,7 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// List of HandBrake containers.
- /// </summary>
+ /// </summary>
private static List<HBContainer> containers;
/// <summary>
@@ -262,8 +261,12 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Returns true if the subtitle source type can be set to forced only.
/// </summary>
- /// <param name="source">The subtitle source type (SSA, VobSub, etc)</param>
- /// <returns>True if the subtitle source type can be set to forced only.</returns>
+ /// <param name="source">
+ /// The subtitle source type (SSA, VobSub, etc)
+ /// </param>
+ /// <returns>
+ /// True if the subtitle source type can be set to forced only.
+ /// </returns>
public static bool SubtitleCanSetForcedOnly(int source)
{
return HBFunctions.hb_subtitle_can_force(source) > 0;
@@ -272,8 +275,12 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Returns true if the subtitle source type can be burned in.
/// </summary>
- /// <param name="source">The subtitle source type (SSA, VobSub, etc)</param>
- /// <returns>True if the subtitle source type can be burned in.</returns>
+ /// <param name="source">
+ /// The subtitle source type (SSA, VobSub, etc)
+ /// </param>
+ /// <returns>
+ /// True if the subtitle source type can be burned in.
+ /// </returns>
public static bool SubtitleCanBurn(int source)
{
return HBFunctions.hb_subtitle_can_burn(source) > 0;
@@ -282,9 +289,15 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Returns true if the subtitle type can be passed through using the given muxer.
/// </summary>
- /// <param name="subtitleSourceType">The subtitle source type (SSA, VobSub, etc)</param>
- /// <param name="muxer">The ID of the muxer.</param>
- /// <returns>True if the subtitle type can be passed through with the given muxer.</returns>
+ /// <param name="subtitleSourceType">
+ /// The subtitle source type (SSA, VobSub, etc)
+ /// </param>
+ /// <param name="muxer">
+ /// The ID of the muxer.
+ /// </param>
+ /// <returns>
+ /// True if the subtitle type can be passed through with the given muxer.
+ /// </returns>
public static bool SubtitleCanPassthrough(int subtitleSourceType, int muxer)
{
return HBFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0;
@@ -293,8 +306,12 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Gets the subtitle source type's name.
/// </summary>
- /// <param name="source">The subtitle source type (SSA, VobSub, etc).</param>
- /// <returns>The name of the subtitle source.</returns>
+ /// <param name="source">
+ /// The subtitle source type (SSA, VobSub, etc).
+ /// </param>
+ /// <returns>
+ /// The name of the subtitle source.
+ /// </returns>
public static string GetSubtitleSourceName(int source)
{
switch ((hb_subtitle_s_subsource)source)
@@ -492,9 +509,9 @@ namespace HandBrake.ApplicationServices.Interop return new VideoQualityLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
@@ -551,7 +568,7 @@ namespace HandBrake.ApplicationServices.Interop /// <returns>
/// Limits on the audio quality for the given encoder.
/// </returns>
- internal static RangeLimits GetAudioQualityLimits(int encoderId)
+ public static RangeLimits GetAudioQualityLimits(int encoderId)
{
float low = 0, high = 0, granularity = 0;
int direction = 0;
@@ -559,9 +576,9 @@ namespace HandBrake.ApplicationServices.Interop return new RangeLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
@@ -575,7 +592,7 @@ namespace HandBrake.ApplicationServices.Interop /// <returns>
/// Limits on the audio compression for the given encoder.
/// </returns>
- internal static RangeLimits GetAudioCompressionLimits(int encoderId)
+ public static RangeLimits GetAudioCompressionLimits(int encoderId)
{
float low = 0, high = 0, granularity = 0;
int direction = 0;
@@ -583,11 +600,39 @@ namespace HandBrake.ApplicationServices.Interop return new RangeLimits
{
- Low = low,
- High = high,
- Granularity = granularity,
+ Low = low,
+ High = high,
+ Granularity = granularity,
Ascending = direction == 0
};
}
+
+ /// <summary>
+ /// The get default quality.
+ /// </summary>
+ /// <param name="encoder">
+ /// The encoder.
+ /// </param>
+ /// <returns>
+ /// The <see cref="double"/>.
+ /// </returns>
+ public static double GetDefaultQuality(HBAudioEncoder encoder)
+ {
+ return HBFunctions.hb_audio_quality_get_default((uint)encoder.Id);
+ }
+
+ /// <summary>
+ /// The get default audio compression.
+ /// </summary>
+ /// <param name="encoder">
+ /// The encoder.
+ /// </param>
+ /// <returns>
+ /// The <see cref="double"/>.
+ /// </returns>
+ public static double GetDefaultAudioCompression(HBAudioEncoder encoder)
+ {
+ return HBFunctions.hb_audio_compression_get_default((uint)encoder.Id);
+ }
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs index a1e93f28b..1b68df438 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs @@ -402,7 +402,6 @@ namespace HandBrake.ApplicationServices.Interop.HbLib [DllImport("hb.dll", EntryPoint = "hb_image_close", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_image_close(IntPtr image);
-
/* JSON API */
// char * hb_get_title_set_json(hb_handle_t * h);
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs deleted file mode 100644 index 3aef81c38..000000000 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs +++ /dev/null @@ -1,89 +0,0 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AudioEncoder.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// The audio encoder enumeration
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Model.Encoding
-{
- using System.ComponentModel.DataAnnotations;
-
- using HandBrake.ApplicationServices.Attributes;
-
- /// <summary>
- /// The audio encoder.
- /// </summary>
- public enum AudioEncoder
- {
- [Display(Name = "AAC (avcodec)")]
- [ShortName("av_aac")]
- ffaac,
-
- [Display(Name = "AAC (FDK)")]
- [ShortName("fdk_aac")]
- fdkaac,
-
- [Display(Name = "HE-AAC (FDK)")]
- [ShortName("fdk_haac")]
- fdkheaac,
-
- [Display(Name = "MP3")]
- [ShortName("mp3")]
- Lame,
-
- [Display(Name = "AC3")]
- [ShortName("ac3")]
- Ac3,
-
- [Display(Name = "Auto Passthru")]
- [ShortName("copy")]
- Passthrough,
-
- [Display(Name = "AC3 Passthru")]
- [ShortName("copy:ac3")]
- Ac3Passthrough,
-
- [Display(Name = "E-AC3 Passthru")]
- [ShortName("copy:eac3")]
- EAc3Passthrough,
-
- [Display(Name = "DTS Passthru")]
- [ShortName("copy:dts")]
- DtsPassthrough,
-
- [Display(Name = "DTS-HD Passthru")]
- [ShortName("copy:dtshd")]
- DtsHDPassthrough,
-
- [Display(Name = "TrueHD Passthru")]
- [ShortName("copy:truehd")]
- TrueHDPassthrough,
-
- [Display(Name = "AAC Passthru")]
- [ShortName("copy:aac")]
- AacPassthru,
-
- [Display(Name = "MP3 Passthru")]
- [ShortName("copy:mp3")]
- Mp3Passthru,
-
- [Display(Name = "Vorbis")]
- [ShortName("vorbis")]
- Vorbis,
-
- [Display(Name = "FLAC 16-bit")]
- [ShortName("flac16")]
- ffflac,
-
- [Display(Name = "FLAC 24-bit")]
- [ShortName("flac24")]
- ffflac24,
-
- [Display(Name = "FLAC Passthru")]
- [ShortName("copy:flac")]
- FlacPassthru,
- }
-}
|