]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove the EncodingProfile object as it doesn't make sense in the context...
authorsr55 <sr55.hb@outlook.com>
Sun, 18 Jan 2015 18:02:25 +0000 (18:02 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 18 Jan 2015 18:02:25 +0000 (18:02 +0000)
Small fix to updated preview window.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6767 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs
win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/AnamorphicFactory.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Json/Factories/EncodeFactory.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Model/EncodeJob.cs
win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs [deleted file]
win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs

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