diff options
author | sr55 <[email protected]> | 2015-01-18 18:02:25 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-18 18:02:25 +0000 |
commit | 3971869f634466f832c3ec33e0e9b1779058156f (patch) | |
tree | 01887b3240085072dc11a0d8bfec84a4f3819b4d /win/CS | |
parent | d972a8646edc79e7f4e373c51dc2fb77233989f2 (diff) |
WinGui: Remove the EncodingProfile object as it doesn't make sense in the context of the app.
Small fix to updated preview window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6767 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
9 files changed, 566 insertions, 637 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs index 2c3f013ff..2ffc766b5 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs @@ -11,9 +11,7 @@ namespace HandBrake.ApplicationServices.Utilities {
using System;
using System.Collections.Generic;
- using System.Diagnostics;
using System.Linq;
- using System.Windows.Media.Animation;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
@@ -25,7 +23,6 @@ namespace HandBrake.ApplicationServices.Utilities /// <summary>
/// A Utility Class to Convert a
- /// TODO remove this class and replace a new factory to convert the EncodeTask object. This will remove a layer of abstraction.
/// </summary>
public class InteropModelCreator
{
@@ -68,15 +65,12 @@ namespace HandBrake.ApplicationServices.Utilities // Which will be converted to this EncodeJob Model.
EncodeJob job = new EncodeJob();
- EncodingProfile profile = new EncodingProfile();
- job.EncodingProfile = profile;
// Audio Settings
- profile.AudioEncodings = new List<AudioEncoding>();
+ job.AudioEncodings = new List<AudioEncoding>();
job.ChosenAudioTracks = new List<int>();
foreach (AudioTrack track in work.AudioTracks)
{
-
AudioEncoding newTrack = new AudioEncoding
{
Bitrate = track.Bitrate,
@@ -87,11 +81,11 @@ namespace HandBrake.ApplicationServices.Utilities Mixdown = Converters.GetCliMixDown(track.MixDown),
SampleRateRaw = GetSampleRateRaw(track.SampleRate),
EncodeRateType = AudioEncodeRateType.Bitrate,
- Name = track.TrackName,
+ Name = track.TrackName,
IsPassthru = track.IsPassthru
};
- profile.AudioEncodings.Add(newTrack);
+ job.AudioEncodings.Add(newTrack);
if (track.Track != null)
{
job.ChosenAudioTracks.Add(track.Track.Value);
@@ -144,111 +138,110 @@ namespace HandBrake.ApplicationServices.Utilities }
job.Angle = work.Angle;
- job.EncodingProfile = profile;
// Output Settings
- profile.IPod5GSupport = work.IPod5GSupport;
- profile.Optimize = work.OptimizeMP4;
+ job.IPod5GSupport = work.IPod5GSupport;
+ job.Optimize = work.OptimizeMP4;
switch (work.OutputFormat)
{
case OutputFormat.Mp4:
- profile.ContainerName = "av_mp4"; // TODO make part of enum.
+ job.ContainerName = "av_mp4"; // TODO make part of enum.
break;
case OutputFormat.Mkv:
- profile.ContainerName = "av_mkv"; // TODO make part of enum.
+ job.ContainerName = "av_mkv"; // TODO make part of enum.
break;
}
// Picture Settings
- profile.Anamorphic = work.Anamorphic;
- profile.Cropping = new Cropping { Top = work.Cropping.Top, Bottom = work.Cropping.Bottom, Left = work.Cropping.Left, Right = work.Cropping.Right };
- profile.CroppingType = CroppingType.Custom; // TODO deal with this better
- profile.DisplayWidth = work.DisplayWidth.HasValue ? int.Parse(Math.Round(work.DisplayWidth.Value, 0).ToString()) : 0;
- profile.PixelAspectX = work.PixelAspectX;
- profile.PixelAspectY = work.PixelAspectY;
- profile.Height = work.Height.HasValue ? work.Height.Value : 0;
- profile.KeepDisplayAspect = work.KeepDisplayAspect;
- profile.MaxHeight = work.MaxHeight.HasValue ? work.MaxHeight.Value : 0;
- profile.MaxWidth = work.MaxWidth.HasValue ? work.MaxWidth.Value : 0;
- profile.Modulus = work.Modulus.HasValue ? work.Modulus.Value : 16;
- profile.UseDisplayWidth = true;
- profile.Width = work.Width.HasValue ? work.Width.Value : 0;
+ job.Anamorphic = work.Anamorphic;
+ job.Cropping = new Cropping { Top = work.Cropping.Top, Bottom = work.Cropping.Bottom, Left = work.Cropping.Left, Right = work.Cropping.Right };
+ job.CroppingType = CroppingType.Custom; // TODO deal with this better
+ job.DisplayWidth = work.DisplayWidth.HasValue ? int.Parse(Math.Round(work.DisplayWidth.Value, 0).ToString()) : 0;
+ job.PixelAspectX = work.PixelAspectX;
+ job.PixelAspectY = work.PixelAspectY;
+ job.Height = work.Height.HasValue ? work.Height.Value : 0;
+ job.KeepDisplayAspect = work.KeepDisplayAspect;
+ job.MaxHeight = work.MaxHeight.HasValue ? work.MaxHeight.Value : 0;
+ job.MaxWidth = work.MaxWidth.HasValue ? work.MaxWidth.Value : 0;
+ job.Modulus = work.Modulus.HasValue ? work.Modulus.Value : 16;
+ job.UseDisplayWidth = true;
+ job.Width = work.Width.HasValue ? work.Width.Value : 0;
// Filter Settings
- profile.CustomDecomb = work.CustomDecomb;
- profile.CustomDeinterlace = work.CustomDeinterlace;
- profile.CustomDenoise = work.CustomDenoise;
- profile.DenoisePreset = work.DenoisePreset.ToString().ToLower().Replace(" ", string.Empty);
- profile.DenoiseTune = work.DenoiseTune.ToString().ToLower().Replace(" ", string.Empty);
- profile.CustomDetelecine = work.CustomDetelecine;
+ job.CustomDecomb = work.CustomDecomb;
+ job.CustomDeinterlace = work.CustomDeinterlace;
+ job.CustomDenoise = work.CustomDenoise;
+ job.DenoisePreset = work.DenoisePreset.ToString().ToLower().Replace(" ", string.Empty);
+ job.DenoiseTune = work.DenoiseTune.ToString().ToLower().Replace(" ", string.Empty);
+ job.CustomDetelecine = work.CustomDetelecine;
if (work.Deblock > 4)
{
- profile.Deblock = work.Deblock;
+ job.Deblock = work.Deblock;
}
- profile.Decomb = work.Decomb;
- profile.Deinterlace = work.Deinterlace;
- profile.Denoise = work.Denoise;
- profile.Detelecine = work.Detelecine;
- profile.Grayscale = work.Grayscale;
+ job.Decomb = work.Decomb;
+ job.Deinterlace = work.Deinterlace;
+ job.Denoise = work.Denoise;
+ job.Detelecine = work.Detelecine;
+ job.Grayscale = work.Grayscale;
// Video Settings
- profile.Framerate = work.Framerate.HasValue ? work.Framerate.Value : 0;
- profile.ConstantFramerate = work.FramerateMode == FramerateMode.CFR;
- profile.PeakFramerate = work.FramerateMode == FramerateMode.PFR;
- profile.Quality = work.Quality.HasValue ? work.Quality.Value : 0;
- profile.VideoBitrate = work.VideoBitrate.HasValue ? work.VideoBitrate.Value : 0;
- profile.VideoEncodeRateType = work.VideoEncodeRateType;
- profile.VideoEncoder = Converters.GetVideoEncoder(work.VideoEncoder);
- profile.TwoPass = work.TwoPass;
- profile.TurboFirstPass = work.TurboFirstPass;
+ job.Framerate = work.Framerate.HasValue ? work.Framerate.Value : 0;
+ job.ConstantFramerate = work.FramerateMode == FramerateMode.CFR;
+ job.PeakFramerate = work.FramerateMode == FramerateMode.PFR;
+ job.Quality = work.Quality.HasValue ? work.Quality.Value : 0;
+ job.VideoBitrate = work.VideoBitrate.HasValue ? work.VideoBitrate.Value : 0;
+ job.VideoEncodeRateType = work.VideoEncodeRateType;
+ job.VideoEncoder = Converters.GetVideoEncoder(work.VideoEncoder);
+ job.TwoPass = work.TwoPass;
+ job.TurboFirstPass = work.TurboFirstPass;
if (work.VideoEncoder == VideoEncoder.X264)
{
- profile.VideoPreset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);
- profile.VideoTunes = new List<string>();
+ job.VideoPreset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);
+ job.VideoTunes = new List<string>();
if (work.X264Tune != x264Tune.None)
{
- profile.VideoTunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));
+ job.VideoTunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));
}
if (work.FastDecode)
{
- profile.VideoTunes.Add("fastdecode");
+ job.VideoTunes.Add("fastdecode");
}
- profile.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.
- profile.VideoLevel = work.H264Level;
+ job.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.
+ job.VideoLevel = work.H264Level;
}
else if (work.VideoEncoder == VideoEncoder.X265)
{
- profile.VideoPreset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);
+ job.VideoPreset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);
if (work.H265Profile != x265Profile.None)
{
- profile.VideoProfile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);
+ job.VideoProfile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);
}
- profile.VideoTunes = new List<string>();
+ job.VideoTunes = new List<string>();
if (work.X265Tune != x265Tune.None)
{
- profile.VideoTunes.Add(work.X265Tune.ToString().ToLower().Replace(" ", string.Empty));
+ job.VideoTunes.Add(work.X265Tune.ToString().ToLower().Replace(" ", string.Empty));
}
}
else if (work.VideoEncoder == VideoEncoder.QuickSync)
{
- profile.VideoPreset = work.QsvPreset.ToString().ToLower().Replace(" ", string.Empty);
- profile.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty);
- profile.VideoLevel = work.H264Level;
+ job.VideoPreset = work.QsvPreset.ToString().ToLower().Replace(" ", string.Empty);
+ job.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty);
+ job.VideoLevel = work.H264Level;
}
// Chapter Markers
- profile.IncludeChapterMarkers = work.IncludeChapterMarkers;
+ job.IncludeChapterMarkers = work.IncludeChapterMarkers;
job.CustomChapterNames = work.ChapterNames.Select(item => item.ChapterName).ToList();
job.UseDefaultChapterNames = work.IncludeChapterMarkers;
// Advanced Settings
- profile.VideoOptions = work.ShowAdvancedTab ? work.AdvancedEncoderOptions : work.ExtraAdvancedArguments;
+ job.VideoOptions = work.ShowAdvancedTab ? work.AdvancedEncoderOptions : work.ExtraAdvancedArguments;
// Subtitles
job.Subtitles = new Subtitles { SourceSubtitles = new List<SourceSubtitle>(), SrtSubtitles = new List<SrtSubtitle>() };
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index a36e672ca..4d9b6791b 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -292,20 +292,20 @@ namespace HandBrake.Interop // Creat the Expected Output Geometry details for libhb.
hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{
- crop = new[] { job.EncodingProfile.Cropping.Top, job.EncodingProfile.Cropping.Bottom, job.EncodingProfile.Cropping.Left, job.EncodingProfile.Cropping.Right },
+ crop = new[] { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
itu_par = 0,
- keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (job.EncodingProfile.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
- maxWidth = job.EncodingProfile.MaxWidth,
- maxHeight = job.EncodingProfile.MaxHeight,
- mode = (int)(hb_anamorphic_mode_t)job.EncodingProfile.Anamorphic,
- modulus = job.EncodingProfile.Modulus,
+ keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (job.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
+ maxWidth = job.MaxWidth,
+ maxHeight = job.MaxHeight,
+ mode = (int)(hb_anamorphic_mode_t)job.Anamorphic,
+ modulus = job.Modulus,
geometry = new hb_geometry_s
{
- height = job.EncodingProfile.Height,
- width = job.EncodingProfile.Width,
- par = job.EncodingProfile.Anamorphic != Anamorphic.Custom
+ height = job.Height,
+ width = job.Width,
+ par = job.Anamorphic != Anamorphic.Custom
? new hb_rational_t { den = title.ParVal.Height, num = title.ParVal.Width }
- : new hb_rational_t { den = job.EncodingProfile.PixelAspectY, num = job.EncodingProfile.PixelAspectX }
+ : new hb_rational_t { den = job.PixelAspectY, num = job.PixelAspectX }
}
};
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj index f153d2dca..52939e219 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj @@ -241,7 +241,6 @@ <Compile Include="Model\Encoding\Deinterlace.cs" />
<Compile Include="Model\Encoding\Denoise.cs" />
<Compile Include="Model\Encoding\Detelecine.cs" />
- <Compile Include="Model\Encoding\EncodingProfile.cs" />
<Compile Include="Model\Encoding\HBContainer.cs" />
<Compile Include="Model\Encoding\HBMixdown.cs" />
<Compile Include="Model\Encoding\HBRate.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs index abb67a074..1d7042ab3 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs @@ -456,7 +456,7 @@ namespace HandBrake.Interop {
long availableBytes = ((long)sizeMB) * 1024 * 1024;
- EncodingProfile profile = job.EncodingProfile;
+ EncodeJob profile = job;
double lengthSeconds = overallSelectedLengthSeconds > 0 ? overallSelectedLengthSeconds : GetJobLengthSeconds(job, title);
lengthSeconds += 1.5;
@@ -509,7 +509,7 @@ namespace HandBrake.Interop {
long totalBytes = 0;
- EncodingProfile profile = job.EncodingProfile;
+ EncodeJob profile = job;
double lengthSeconds = GetJobLengthSeconds(job, title);
lengthSeconds += 1.5;
@@ -579,7 +579,7 @@ namespace HandBrake.Interop {
var list = new List<Tuple<AudioEncoding, int>>();
- foreach (AudioEncoding encoding in job.EncodingProfile.AudioEncodings)
+ foreach (AudioEncoding encoding in job.AudioEncodings)
{
if (encoding.InputNumber == 0)
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs index 97809c348..1fd16ec5e 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs @@ -53,7 +53,7 @@ namespace HandBrake.Interop.Json.Factories /// </returns>
public static Geometry CreateGeometry(EncodeJob job, Title title, KeepSetting keepWidthOrHeight) // Todo remove the need for these objects. Should use simpler objects.
{
- int settingMode = (int)keepWidthOrHeight + (job.EncodingProfile.KeepDisplayAspect ? 0x04 : 0);
+ int settingMode = (int)keepWidthOrHeight + (job.KeepDisplayAspect ? 0x04 : 0);
// Sanatise the Geometry First.
AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry
@@ -66,27 +66,27 @@ namespace HandBrake.Interop.Json.Factories },
DestSettings = new DestSettings
{
- AnamorphicMode = (int)job.EncodingProfile.Anamorphic,
+ AnamorphicMode = (int)job.Anamorphic,
Geometry = {
- Width = job.EncodingProfile.Width, Height = job.EncodingProfile.Height,
+ Width = job.Width, Height = job.Height,
PAR = new PAR
{
- Num = job.EncodingProfile.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.EncodingProfile.PixelAspectX,
- Den = job.EncodingProfile.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.EncodingProfile.PixelAspectY,
+ Num = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : job.PixelAspectX,
+ Den = job.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : job.PixelAspectY,
}
},
Keep = settingMode,
- Crop = new List<int> { job.EncodingProfile.Cropping.Top, job.EncodingProfile.Cropping.Bottom, job.EncodingProfile.Cropping.Left, job.EncodingProfile.Cropping.Right },
- Modulus = job.EncodingProfile.Modulus,
- MaxWidth = job.EncodingProfile.MaxWidth,
- MaxHeight = job.EncodingProfile.MaxHeight,
+ Crop = new List<int> { job.Cropping.Top, job.Cropping.Bottom, job.Cropping.Left, job.Cropping.Right },
+ Modulus = job.Modulus,
+ MaxWidth = job.MaxWidth,
+ MaxHeight = job.MaxHeight,
ItuPAR = false
}
};
- if (job.EncodingProfile.Anamorphic == Anamorphic.Custom)
+ if (job.Anamorphic == Anamorphic.Custom)
{
- anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = job.EncodingProfile.PixelAspectX, Den = job.EncodingProfile.PixelAspectY };
+ anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = job.PixelAspectX, Den = job.PixelAspectY };
}
else
{
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs index 51b29533f..327e5ce9f 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs @@ -126,11 +126,11 @@ namespace HandBrake.Interop.Json.Factories File = job.OutputPath,
Mp4Options = new Mp4Options
{
- IpodAtom = job.EncodingProfile.IPod5GSupport,
- Mp4Optimize = job.EncodingProfile.Optimize
+ IpodAtom = job.IPod5GSupport,
+ Mp4Optimize = job.Optimize
},
- ChapterMarkers = job.EncodingProfile.IncludeChapterMarkers,
- Mux = HBFunctions.hb_container_get_from_name(job.EncodingProfile.ContainerName),
+ ChapterMarkers = job.IncludeChapterMarkers,
+ Mux = HBFunctions.hb_container_get_from_name(job.ContainerName),
ChapterList = new List<ChapterList>()
};
@@ -241,23 +241,23 @@ namespace HandBrake.Interop.Json.Factories {
Video video = new Video();
- HBVideoEncoder videoEncoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(e => e.ShortName == job.EncodingProfile.VideoEncoder);
- Validate.NotNull(videoEncoder, "Video encoder " + job.EncodingProfile.VideoEncoder + " not recognized.");
+ HBVideoEncoder videoEncoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(e => e.ShortName == job.VideoEncoder);
+ Validate.NotNull(videoEncoder, "Video encoder " + job.VideoEncoder + " not recognized.");
if (videoEncoder != null)
{
video.Codec = videoEncoder.Id;
}
- video.TwoPass = job.EncodingProfile.TwoPass;
- video.Turbo = job.EncodingProfile.TurboFirstPass;
- video.Level = job.EncodingProfile.VideoLevel;
- video.Options = job.EncodingProfile.VideoOptions;
- video.Preset = job.EncodingProfile.VideoPreset;
- video.Profile = job.EncodingProfile.VideoProfile;
- video.Quality = job.EncodingProfile.Quality;
- if (job.EncodingProfile.VideoTunes != null && job.EncodingProfile.VideoTunes.Count > 0)
+ video.TwoPass = job.TwoPass;
+ video.Turbo = job.TurboFirstPass;
+ video.Level = job.VideoLevel;
+ video.Options = job.VideoOptions;
+ video.Preset = job.VideoPreset;
+ video.Profile = job.VideoProfile;
+ video.Quality = job.Quality;
+ if (job.VideoTunes != null && job.VideoTunes.Count > 0)
{
- video.Tune = string.Join(",", job.EncodingProfile.VideoTunes);
+ video.Tune = string.Join(",", job.VideoTunes);
}
return video;
@@ -276,10 +276,10 @@ namespace HandBrake.Interop.Json.Factories {
Audio audio = new Audio();
- if (!string.IsNullOrEmpty(job.EncodingProfile.AudioEncoderFallback))
+ if (!string.IsNullOrEmpty(job.AudioEncoderFallback))
{
- HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.EncodingProfile.AudioEncoderFallback);
- Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.EncodingProfile.AudioEncoderFallback);
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.AudioEncoderFallback);
+ Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.AudioEncoderFallback);
audio.FallbackEncoder = audioEncoder.Id;
}
@@ -287,7 +287,7 @@ namespace HandBrake.Interop.Json.Factories audio.AudioList = new List<AudioList>();
int numTracks = 0;
- foreach (AudioEncoding item in job.EncodingProfile.AudioEncodings)
+ foreach (AudioEncoding item in job.AudioEncodings)
{
HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(item.Encoder);
Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
@@ -348,31 +348,31 @@ namespace HandBrake.Interop.Json.Factories Filter filter = new Filter
{
FilterList = new List<FilterList>(),
- Grayscale = job.EncodingProfile.Grayscale
+ Grayscale = job.Grayscale
};
// Detelecine
- if (job.EncodingProfile.Detelecine != Detelecine.Off)
+ if (job.Detelecine != Detelecine.Off)
{
- FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DETELECINE, Settings = job.EncodingProfile.CustomDetelecine };
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DETELECINE, Settings = job.CustomDetelecine };
filter.FilterList.Add(filterItem);
}
// Decomb
- if (job.EncodingProfile.Decomb != Decomb.Off)
+ if (job.Decomb != Decomb.Off)
{
string options;
- if (job.EncodingProfile.Decomb == Decomb.Fast)
+ if (job.Decomb == Decomb.Fast)
{
options = "7:2:6:9:1:80";
}
- else if (job.EncodingProfile.Decomb == Decomb.Bob)
+ else if (job.Decomb == Decomb.Bob)
{
options = "455";
}
else
{
- options = job.EncodingProfile.CustomDecomb;
+ options = job.CustomDecomb;
}
FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DECOMB, Settings = options };
@@ -380,28 +380,28 @@ namespace HandBrake.Interop.Json.Factories }
// Deinterlace
- if (job.EncodingProfile.Deinterlace != Deinterlace.Off)
+ if (job.Deinterlace != Deinterlace.Off)
{
string options;
- if (job.EncodingProfile.Deinterlace == Deinterlace.Fast)
+ if (job.Deinterlace == Deinterlace.Fast)
{
options = "0";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Slow)
+ else if (job.Deinterlace == Deinterlace.Slow)
{
options = "1";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Slower)
+ else if (job.Deinterlace == Deinterlace.Slower)
{
options = "3";
}
- else if (job.EncodingProfile.Deinterlace == Deinterlace.Bob)
+ else if (job.Deinterlace == Deinterlace.Bob)
{
options = "15";
}
else
{
- options = job.EncodingProfile.CustomDeinterlace;
+ options = job.CustomDeinterlace;
}
FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEINTERLACE, Settings = options };
@@ -409,8 +409,8 @@ namespace HandBrake.Interop.Json.Factories }
// VFR / CFR
- int fm = job.EncodingProfile.ConstantFramerate ? 1 : job.EncodingProfile.PeakFramerate ? 2 : 0;
- IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.EncodingProfile.Framerate.ToString(CultureInfo.InvariantCulture));
+ int fm = job.ConstantFramerate ? 1 : job.PeakFramerate ? 2 : 0;
+ IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.Framerate.ToString(CultureInfo.InvariantCulture));
int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
int num;
@@ -433,28 +433,28 @@ namespace HandBrake.Interop.Json.Factories filter.FilterList.Add(framerateShaper);
// Deblock
- if (job.EncodingProfile.Deblock >= 5)
+ if (job.Deblock >= 5)
{
- FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEBLOCK, Settings = job.EncodingProfile.Deblock.ToString() };
+ FilterList filterItem = new FilterList { ID = (int)hb_filter_ids.HB_FILTER_DEBLOCK, Settings = job.Deblock.ToString() };
filter.FilterList.Add(filterItem);
}
// Denoise
- if (job.EncodingProfile.Denoise != Denoise.Off)
+ if (job.Denoise != Denoise.Off)
{
- hb_filter_ids id = job.EncodingProfile.Denoise == Denoise.hqdn3d
+ hb_filter_ids id = job.Denoise == Denoise.hqdn3d
? hb_filter_ids.HB_FILTER_HQDN3D
: hb_filter_ids.HB_FILTER_NLMEANS;
string settings;
- if (job.EncodingProfile.Denoise == Denoise.hqdn3d
- && !string.IsNullOrEmpty(job.EncodingProfile.CustomDenoise))
+ if (job.Denoise == Denoise.hqdn3d
+ && !string.IsNullOrEmpty(job.CustomDenoise))
{
- settings = job.EncodingProfile.CustomDenoise;
+ settings = job.CustomDenoise;
}
else
{
- IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)id, job.EncodingProfile.DenoisePreset, job.EncodingProfile.DenoiseTune);
+ IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings((int)id, job.DenoisePreset, job.DenoiseTune);
settings = Marshal.PtrToStringAnsi(settingsPtr);
}
@@ -472,10 +472,10 @@ namespace HandBrake.Interop.Json.Factories "{0}:{1}:{2}:{3}:{4}:{5}",
resultGeometry.Width,
resultGeometry.Height,
- job.EncodingProfile.Cropping.Top,
- job.EncodingProfile.Cropping.Bottom,
- job.EncodingProfile.Cropping.Left,
- job.EncodingProfile.Cropping.Right)
+ job.Cropping.Top,
+ job.Cropping.Bottom,
+ job.Cropping.Left,
+ job.Cropping.Right)
};
filter.FilterList.Add(cropScale);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs index cd54342a7..ce7209948 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs @@ -9,147 +9,416 @@ namespace HandBrake.Interop.Model
{
- using System;
- using System.Collections.Generic;
- using System.Xml.Serialization;
+ using System.Collections.Generic;
- using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding;
- /// <summary>
+ /// <summary>
/// The encode job.
/// </summary>
public class EncodeJob
{
- #region Properties
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeJob"/> class.
+ /// </summary>
+ public EncodeJob()
+ {
+ this.Cropping = new Cropping();
+ }
- /// <summary>
- /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
- /// </summary>
- public int Angle { get; set; }
+ #region Source
- /// <summary>
- /// Gets or sets the chapter end.
- /// </summary>
- public int ChapterEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the source path.
+ /// </summary>
+ public string SourcePath { get; set; }
- /// <summary>
- /// Gets or sets the chapter start.
- /// </summary>
- public int ChapterStart { get; set; }
+ /// <summary>
+ /// Gets or sets the 1-based index of the title to encode.
+ /// </summary>
+ public int Title { get; set; }
- /// <summary>
- /// Gets or sets the list of chosen audio tracks (1-based)
- /// </summary>
- public List<int> ChosenAudioTracks { get; set; }
+ /// <summary>
+ /// Gets or sets the range type.
+ /// </summary>
+ public VideoRangeType RangeType { get; set; }
- /// <summary>
- /// Gets or sets the custom chapter names.
- /// </summary>
- public List<string> CustomChapterNames { get; set; }
+ /// <summary>
+ /// Gets or sets the seek points.
+ /// This is the number of preview points.
+ /// </summary>
+ public int SeekPoints { get; set; }
- /// <summary>
- /// Gets or sets the encoding profile.
- /// </summary>
- public EncodingProfile EncodingProfile { get; set; }
+ /// <summary>
+ /// Gets or sets the start at preview.
+ /// </summary>
+ public int StartAtPreview { get; set; }
- /// <summary>
- /// Gets or sets the frames end.
- /// </summary>
- public int FramesEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the seconds end.
+ /// </summary>
+ public int SecondsEnd { get; set; }
- /// <summary>
- /// Gets or sets the frames start.
- /// </summary>
- public int FramesStart { get; set; }
+ /// <summary>
+ /// Gets or sets the seconds start.
+ /// </summary>
+ public double SecondsStart { get; set; }
- /// <summary>
- /// Gets or sets the length. The length of video to encode.
- /// </summary>
- [XmlIgnore]
- public TimeSpan Length { get; set; }
+ /// <summary>
+ /// Gets or sets the angle to encode. 0 for default, 1+ for specified angle.
+ /// </summary>
+ public int Angle { get; set; }
- /// <summary>
- /// Gets or sets the output path.
- /// </summary>
- public string OutputPath { get; set; }
+ /// <summary>
+ /// Gets or sets the chapter end.
+ /// </summary>
+ public int ChapterEnd { get; set; }
- /// <summary>
- /// Gets or sets the range type.
- /// </summary>
- public VideoRangeType RangeType { get; set; }
+ /// <summary>
+ /// Gets or sets the chapter start.
+ /// </summary>
+ public int ChapterStart { get; set; }
- /// <summary>
- /// Gets or sets the seek points.
- /// This is the number of preview points.
- /// </summary>
- public int SeekPoints { get; set; }
+ /// <summary>
+ /// Gets or sets the frames end.
+ /// </summary>
+ public int FramesEnd { get; set; }
- /// <summary>
- /// Gets or sets the start at preview.
- /// </summary>
- public int StartAtPreview { get; set; }
+ /// <summary>
+ /// Gets or sets the frames start.
+ /// </summary>
+ public int FramesStart { get; set; }
- /// <summary>
- /// Gets or sets the seconds end.
- /// </summary>
- public int SecondsEnd { get; set; }
+ /// <summary>
+ /// Gets or sets the source type.
+ /// </summary>
+ public SourceType SourceType { get; set; }
- /// <summary>
- /// Gets or sets the seconds start.
- /// </summary>
- public double SecondsStart { get; set; }
+ #endregion
- /// <summary>
- /// Gets or sets the source path.
- /// </summary>
- public string SourcePath { get; set; }
+ #region Destination and Output Settings
- /// <summary>
- /// Gets or sets the source type.
- /// </summary>
- public SourceType SourceType { get; set; }
+ /// <summary>
+ /// Gets or sets the output path.
+ /// </summary>
+ public string OutputPath { get; set; }
- /// <summary>
- /// Gets or sets the subtitles.
- /// </summary>
- public Subtitles Subtitles { get; set; }
+ /// <summary>
+ /// Gets or sets the container name.
+ /// </summary>
+ public string ContainerName { get; set; }
- /// <summary>
- /// Gets or sets the 1-based index of the title to encode.
- /// </summary>
- public int Title { get; set; }
+ /// <summary>
+ /// Gets or sets the preferred extension.
+ /// </summary>
+ public OutputExtension PreferredExtension { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether use default chapter names.
- /// </summary>
- public bool UseDefaultChapterNames { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether include chapter markers.
+ /// </summary>
+ public bool IncludeChapterMarkers { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to use DXVA hardware decoding.
- /// </summary>
- public bool DxvaDecoding { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether optimize.
+ /// </summary>
+ public bool Optimize { get; set; }
- /// <summary>
- /// Gets or sets the xml length.
- /// </summary>
- [XmlElement("Length")]
- public string XmlLength
- {
- get
- {
- return this.Length.ToString();
- }
- set
- {
- this.Length = TimeSpan.Parse(value);
- }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether i pod 5 g support.
+ /// </summary>
+ public bool IPod5GSupport { get; set; }
+ #endregion
- #endregion
+ #region Picture Settings
+
+ /// <summary>
+ /// Gets or sets the width.
+ /// </summary>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height.
+ /// </summary>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max width.
+ /// </summary>
+ public int MaxWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max height.
+ /// </summary>
+ public int MaxHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets the scale method.
+ /// </summary>
+ public ScaleMethod ScaleMethod { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cropping type.
+ /// </summary>
+ public CroppingType CroppingType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cropping.
+ /// </summary>
+ public Cropping Cropping { get; set; }
+
+ /// <summary>
+ /// Gets or sets the anamorphic.
+ /// </summary>
+ public Anamorphic Anamorphic { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether use display width.
+ /// </summary>
+ public bool UseDisplayWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display width.
+ /// </summary>
+ public int DisplayWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether keep display aspect.
+ /// </summary>
+ public bool KeepDisplayAspect { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect x.
+ /// </summary>
+ public int PixelAspectX { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pixel aspect y.
+ /// </summary>
+ public int PixelAspectY { get; set; }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public int Modulus { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rotation.
+ /// </summary>
+ public PictureRotation Rotation { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the picture should be flipped horizontally.
+ /// </summary>
+ public bool FlipHorizontal { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the picture should be flipped vertically.
+ /// </summary>
+ public bool FlipVertical { get; set; }
+ #endregion
+
+ #region Filters
- #region Public Methods
+ /// <summary>
+ /// Gets or sets the deinterlace.
+ /// </summary>
+ public Deinterlace Deinterlace { get; set; }
- /// <summary>
+ /// <summary>
+ /// Gets or sets the custom deinterlace.
+ /// </summary>
+ public string CustomDeinterlace { get; set; }
+
+ /// <summary>
+ /// Gets or sets the decomb.
+ /// </summary>
+ public Decomb Decomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom decomb.
+ /// </summary>
+ public string CustomDecomb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the detelecine.
+ /// </summary>
+ public Detelecine Detelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom detelecine.
+ /// </summary>
+ public string CustomDetelecine { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise.
+ /// </summary>
+ public Denoise Denoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise preset name.
+ /// </summary>
+ public string DenoisePreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the denoise tune name.
+ /// </summary>
+ public string DenoiseTune { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should use the provided
+ /// custom denoise string or we should use the preset and tune.
+ /// </summary>
+ public bool UseCustomDenoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom denoise.
+ /// </summary>
+ public string CustomDenoise { get; set; }
+
+ /// <summary>
+ /// Gets or sets the deblock.
+ /// </summary>
+ public int Deblock { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the grayscale filter will be applied.
+ /// </summary>
+ public bool Grayscale { get; set; }
+ #endregion
+
+ #region Video
+
+ /// <summary>
+ /// Gets or sets the video encoder.
+ /// </summary>
+ public string VideoEncoder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder options.
+ /// </summary>
+ public string VideoOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder profile name.
+ /// </summary>
+ public string VideoProfile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder preset name.
+ /// </summary>
+ public string VideoPreset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder tunes.
+ /// </summary>
+ public List<string> VideoTunes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encoder level.
+ /// </summary>
+ public string VideoLevel { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use QSV decoding.
+ /// </summary>
+ public bool QsvDecode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video encode rate type.
+ /// </summary>
+ public VideoEncodeRateType VideoEncodeRateType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quality.
+ /// </summary>
+ public double Quality { get; set; }
+
+ /// <summary>
+ /// Gets or sets the target size.
+ /// </summary>
+ public int TargetSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video bitrate.
+ /// </summary>
+ public int VideoBitrate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether two pass.
+ /// </summary>
+ public bool TwoPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether turbo first pass.
+ /// </summary>
+ public bool TurboFirstPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets the framerate.
+ /// </summary>
+ public double Framerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether constant framerate.
+ /// </summary>
+ public bool ConstantFramerate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether peak framerate.
+ /// </summary>
+ public bool PeakFramerate { get; set; }
+ #endregion
+
+ #region Audio
+
+ /// <summary>
+ /// Gets or sets the audio encodings.
+ /// </summary>
+ public List<AudioEncoding> AudioEncodings { get; set; }
+
+ /// <summary>
+ /// Gets or sets the list of chosen audio tracks (1-based)
+ /// </summary>
+ public List<int> ChosenAudioTracks { get; set; }
+
+ /// <summary>
+ /// Gets or sets the audio encoder fallback.
+ /// </summary>
+ public string AudioEncoderFallback { get; set; }
+ #endregion
+
+ #region Chapter Markers
+
+ /// <summary>
+ /// Gets or sets a value indicating whether use default chapter names.
+ /// </summary>
+ public bool UseDefaultChapterNames { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom chapter names.
+ /// </summary>
+ public List<string> CustomChapterNames { get; set; }
+ #endregion
+
+ #region Subtitles
+
+ /// <summary>
+ /// Gets or sets the subtitles.
+ /// </summary>
+ public Subtitles Subtitles { get; set; }
+ #endregion
+
+ #region Additional Args
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use DXVA hardware decoding.
+ /// </summary>
+ public bool DxvaDecoding { get; set; }
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
/// The clone.
/// </summary>
/// <returns>
@@ -172,11 +441,66 @@ namespace HandBrake.Interop.Model FramesEnd = this.FramesEnd,
ChosenAudioTracks = new List<int>(this.ChosenAudioTracks),
Subtitles = this.Subtitles,
- UseDefaultChapterNames = this.UseDefaultChapterNames,
- DxvaDecoding = this.DxvaDecoding,
+ UseDefaultChapterNames = this.UseDefaultChapterNames,
+ DxvaDecoding = this.DxvaDecoding,
OutputPath = this.OutputPath,
- EncodingProfile = this.EncodingProfile,
- Length = this.Length
+
+ ContainerName = this.ContainerName,
+ PreferredExtension = this.PreferredExtension,
+ IncludeChapterMarkers = this.IncludeChapterMarkers,
+ Optimize = this.Optimize,
+ IPod5GSupport = this.IPod5GSupport,
+
+ Width = this.Width,
+ Height = this.Height,
+ MaxWidth = this.MaxWidth,
+ MaxHeight = this.MaxHeight,
+ ScaleMethod = this.ScaleMethod,
+ CroppingType = this.CroppingType,
+ Cropping = this.Cropping.Clone(),
+ Anamorphic = this.Anamorphic,
+ UseDisplayWidth = this.UseDisplayWidth,
+ DisplayWidth = this.DisplayWidth,
+ KeepDisplayAspect = this.KeepDisplayAspect,
+ PixelAspectX = this.PixelAspectX,
+ PixelAspectY = this.PixelAspectY,
+ Modulus = this.Modulus,
+ Rotation = this.Rotation,
+ FlipHorizontal = this.FlipHorizontal,
+ FlipVertical = this.FlipVertical,
+
+ Deinterlace = this.Deinterlace,
+ CustomDeinterlace = this.CustomDeinterlace,
+ Decomb = this.Decomb,
+ CustomDecomb = this.CustomDecomb,
+ Detelecine = this.Detelecine,
+ CustomDetelecine = this.CustomDetelecine,
+ Denoise = this.Denoise,
+ DenoisePreset = this.DenoisePreset,
+ DenoiseTune = this.DenoiseTune,
+ UseCustomDenoise = this.UseCustomDenoise,
+ CustomDenoise = this.CustomDenoise,
+ Deblock = this.Deblock,
+ Grayscale = this.Grayscale,
+
+ VideoEncoder = this.VideoEncoder,
+ VideoOptions = this.VideoOptions,
+ VideoProfile = this.VideoProfile,
+ VideoPreset = this.VideoPreset,
+ VideoTunes = this.VideoTunes,
+ VideoLevel = this.VideoLevel,
+ QsvDecode = this.QsvDecode,
+ VideoEncodeRateType = this.VideoEncodeRateType,
+ Quality = this.Quality,
+ TargetSize = this.TargetSize,
+ VideoBitrate = this.VideoBitrate,
+ TwoPass = this.TwoPass,
+ TurboFirstPass = this.TurboFirstPass,
+ Framerate = this.Framerate,
+ ConstantFramerate = this.ConstantFramerate,
+
+ AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
+ AudioEncoderFallback = this.AudioEncoderFallback
};
return clone;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs deleted file mode 100644 index 581b9364a..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs +++ /dev/null @@ -1,381 +0,0 @@ -// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="EncodingProfile.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>
-// Defines the EncodingProfile type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.Interop.Model.Encoding
-{
- using System.Collections.Generic;
-
- using HandBrake.Interop.Model;
-
- /// <summary>
- /// The encoding profile.
- /// </summary>
- public class EncodingProfile
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="EncodingProfile"/> class.
- /// </summary>
- public EncodingProfile()
- {
- this.Cropping = new Cropping();
- }
-
- #region Destination and Output Settings
-
- /// <summary>
- /// Gets or sets the container name.
- /// </summary>
- public string ContainerName { get; set; }
-
- /// <summary>
- /// Gets or sets the preferred extension.
- /// </summary>
- public OutputExtension PreferredExtension { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether include chapter markers.
- /// </summary>
- public bool IncludeChapterMarkers { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether optimize.
- /// </summary>
- public bool Optimize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether i pod 5 g support.
- /// </summary>
- public bool IPod5GSupport { get; set; }
- #endregion
-
- #region Picture Settings
-
- /// <summary>
- /// Gets or sets the width.
- /// </summary>
- public int Width { get; set; }
-
- /// <summary>
- /// Gets or sets the height.
- /// </summary>
- public int Height { get; set; }
-
- /// <summary>
- /// Gets or sets the max width.
- /// </summary>
- public int MaxWidth { get; set; }
-
- /// <summary>
- /// Gets or sets the max height.
- /// </summary>
- public int MaxHeight { get; set; }
-
- /// <summary>
- /// Gets or sets the scale method.
- /// </summary>
- public ScaleMethod ScaleMethod { get; set; }
-
- /// <summary>
- /// Gets or sets the cropping type.
- /// </summary>
- public CroppingType CroppingType { get; set; }
-
- /// <summary>
- /// Gets or sets the cropping.
- /// </summary>
- public Cropping Cropping { get; set; }
-
- /// <summary>
- /// Gets or sets the anamorphic.
- /// </summary>
- public Anamorphic Anamorphic { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether use display width.
- /// </summary>
- public bool UseDisplayWidth { get; set; }
-
- /// <summary>
- /// Gets or sets the display width.
- /// </summary>
- public int DisplayWidth { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether keep display aspect.
- /// </summary>
- public bool KeepDisplayAspect { get; set; }
-
- /// <summary>
- /// Gets or sets the pixel aspect x.
- /// </summary>
- public int PixelAspectX { get; set; }
-
- /// <summary>
- /// Gets or sets the pixel aspect y.
- /// </summary>
- public int PixelAspectY { get; set; }
-
- /// <summary>
- /// Gets or sets the modulus.
- /// </summary>
- public int Modulus { get; set; }
-
- /// <summary>
- /// Gets or sets the rotation.
- /// </summary>
- public PictureRotation Rotation { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the picture should be flipped horizontally.
- /// </summary>
- public bool FlipHorizontal { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the picture should be flipped vertically.
- /// </summary>
- public bool FlipVertical { get; set; }
- #endregion
-
- #region Filters
-
- /// <summary>
- /// Gets or sets the deinterlace.
- /// </summary>
- public Deinterlace Deinterlace { get; set; }
-
- /// <summary>
- /// Gets or sets the custom deinterlace.
- /// </summary>
- public string CustomDeinterlace { get; set; }
-
- /// <summary>
- /// Gets or sets the decomb.
- /// </summary>
- public Decomb Decomb { get; set; }
-
- /// <summary>
- /// Gets or sets the custom decomb.
- /// </summary>
- public string CustomDecomb { get; set; }
-
- /// <summary>
- /// Gets or sets the detelecine.
- /// </summary>
- public Detelecine Detelecine { get; set; }
-
- /// <summary>
- /// Gets or sets the custom detelecine.
- /// </summary>
- public string CustomDetelecine { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise.
- /// </summary>
- public Denoise Denoise { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise preset name.
- /// </summary>
- public string DenoisePreset { get; set; }
-
- /// <summary>
- /// Gets or sets the denoise tune name.
- /// </summary>
- public string DenoiseTune { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should use the provided
- /// custom denoise string or we should use the preset and tune.
- /// </summary>
- public bool UseCustomDenoise { get; set; }
-
- /// <summary>
- /// Gets or sets the custom denoise.
- /// </summary>
- public string CustomDenoise { get; set; }
-
- /// <summary>
- /// Gets or sets the deblock.
- /// </summary>
- public int Deblock { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the grayscale filter will be applied.
- /// </summary>
- public bool Grayscale { get; set; }
- #endregion
-
- #region Video
-
- /// <summary>
- /// Gets or sets the video encoder.
- /// </summary>
- public string VideoEncoder { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder options.
- /// </summary>
- public string VideoOptions { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder profile name.
- /// </summary>
- public string VideoProfile { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder preset name.
- /// </summary>
- public string VideoPreset { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder tunes.
- /// </summary>
- public List<string> VideoTunes { get; set; }
-
- /// <summary>
- /// Gets or sets the video encoder level.
- /// </summary>
- public string VideoLevel { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to use QSV decoding.
- /// </summary>
- public bool QsvDecode { get; set; }
-
- /// <summary>
- /// Gets or sets the video encode rate type.
- /// </summary>
- public VideoEncodeRateType VideoEncodeRateType { get; set; }
-
- /// <summary>
- /// Gets or sets the quality.
- /// </summary>
- public double Quality { get; set; }
-
- /// <summary>
- /// Gets or sets the target size.
- /// </summary>
- public int TargetSize { get; set; }
-
- /// <summary>
- /// Gets or sets the video bitrate.
- /// </summary>
- public int VideoBitrate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether two pass.
- /// </summary>
- public bool TwoPass { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether turbo first pass.
- /// </summary>
- public bool TurboFirstPass { get; set; }
-
- /// <summary>
- /// Gets or sets the framerate.
- /// </summary>
- public double Framerate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether constant framerate.
- /// </summary>
- public bool ConstantFramerate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether peak framerate.
- /// </summary>
- public bool PeakFramerate { get; set; }
- #endregion
-
- #region Audio
-
- /// <summary>
- /// Gets or sets the audio encodings.
- /// </summary>
- public List<AudioEncoding> AudioEncodings { get; set; }
-
- /// <summary>
- /// Gets or sets the audio encoder fallback.
- /// </summary>
- public string AudioEncoderFallback { get; set; }
- #endregion
-
- /// <summary>
- /// The clone.
- /// </summary>
- /// <returns>
- /// The <see cref="EncodingProfile"/>.
- /// </returns>
- public EncodingProfile Clone()
- {
- var profile = new EncodingProfile
- {
- ContainerName = this.ContainerName,
- PreferredExtension = this.PreferredExtension,
- IncludeChapterMarkers = this.IncludeChapterMarkers,
- Optimize = this.Optimize,
- IPod5GSupport = this.IPod5GSupport,
-
- Width = this.Width,
- Height = this.Height,
- MaxWidth = this.MaxWidth,
- MaxHeight = this.MaxHeight,
- ScaleMethod = this.ScaleMethod,
- CroppingType = this.CroppingType,
- Cropping = this.Cropping.Clone(),
- Anamorphic = this.Anamorphic,
- UseDisplayWidth = this.UseDisplayWidth,
- DisplayWidth = this.DisplayWidth,
- KeepDisplayAspect = this.KeepDisplayAspect,
- PixelAspectX = this.PixelAspectX,
- PixelAspectY = this.PixelAspectY,
- Modulus = this.Modulus,
- Rotation = this.Rotation,
- FlipHorizontal = this.FlipHorizontal,
- FlipVertical = this.FlipVertical,
-
- Deinterlace = this.Deinterlace,
- CustomDeinterlace = this.CustomDeinterlace,
- Decomb = this.Decomb,
- CustomDecomb = this.CustomDecomb,
- Detelecine = this.Detelecine,
- CustomDetelecine = this.CustomDetelecine,
- Denoise = this.Denoise,
- DenoisePreset = this.DenoisePreset,
- DenoiseTune = this.DenoiseTune,
- UseCustomDenoise = this.UseCustomDenoise,
- CustomDenoise = this.CustomDenoise,
- Deblock = this.Deblock,
- Grayscale = this.Grayscale,
-
- VideoEncoder = this.VideoEncoder,
- VideoOptions = this.VideoOptions,
- VideoProfile = this.VideoProfile,
- VideoPreset = this.VideoPreset,
- VideoTunes = this.VideoTunes,
- VideoLevel = this.VideoLevel,
- QsvDecode = this.QsvDecode,
- VideoEncodeRateType = this.VideoEncodeRateType,
- Quality = this.Quality,
- TargetSize = this.TargetSize,
- VideoBitrate = this.VideoBitrate,
- TwoPass = this.TwoPass,
- TurboFirstPass = this.TurboFirstPass,
- Framerate = this.Framerate,
- ConstantFramerate = this.ConstantFramerate,
-
- AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
- AudioEncoderFallback = this.AudioEncoderFallback
- };
-
- return profile;
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 77cd826db..d360ab0ea 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -138,7 +138,6 @@ namespace HandBrakeWPF.ViewModels this.Title = "Preview";
this.Percentage = "0.00%";
this.PercentageValue = 0;
- this.StartAt = 1;
this.Duration = 30;
this.CanPlay = true;
@@ -324,11 +323,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Gets or sets StartAt.
- /// </summary>
- public int StartAt { get; set; }
-
- /// <summary>
/// Gets StartPoints.
/// </summary>
public IEnumerable<int> StartPoints
@@ -523,7 +517,7 @@ namespace HandBrakeWPF.ViewModels EncodeTask encodeTask = new EncodeTask(this.Task)
{
PreviewDuration = this.Duration,
- PreviewStartAt = this.StartAt,
+ PreviewStartAt = this.SelectedPreviewImage,
PointToPointMode = PointToPointMode.Preview
};
@@ -547,7 +541,7 @@ namespace HandBrakeWPF.ViewModels // Setup the encode task as a preview encode
encodeTask.IsPreviewEncode = true;
- encodeTask.PreviewEncodeStartAt = this.StartAt;
+ encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage; // TODO 0 and 1 mean the same. Need to fix this as it knocks the video out of sync with the still preview.
encodeTask.PreviewEncodeDuration = this.Duration;
QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create());
ThreadPool.QueueUserWorkItem(this.CreatePreview, task);
|