diff options
author | sr55 <[email protected]> | 2019-04-25 18:11:06 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-05-02 18:53:52 +0100 |
commit | feb363eba5e4e914893c4b096402d7d7f9a4a747 (patch) | |
tree | 31d485d790e58868c3ed19838e14fae3c6c9e41f /win/CS/HandBrakeWPF/Services | |
parent | 851c732ad36525175db37ad9f59b31361ba8f876 (diff) |
WinGui: Update the UI for the new deblock filter. #2028
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
5 files changed, 17 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs index 3c6e4d35c..72948a332 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -503,9 +503,9 @@ namespace HandBrakeWPF.Services.Encode.Factories } // Deblock - if (job.Deblock >= 5) + if (job.DeblockPreset != null && job.DeblockPreset.Key != "off") { - IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings_json((int)hb_filter_ids.HB_FILTER_DEBLOCK, null, null, string.Format("qp={0}", job.Deblock)); + IntPtr settingsPtr = HBFunctions.hb_generate_filter_settings_json((int)hb_filter_ids.HB_FILTER_DEBLOCK, job.DeblockPreset.Key, job.DeblockTune.Key, job.CustomDeblock); string unparsedJson = Marshal.PtrToStringAnsi(settingsPtr); if (!string.IsNullOrEmpty(unparsedJson)) { diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs index 3daf6b353..8cc635017 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskImportFactory.cs @@ -271,7 +271,6 @@ namespace HandBrakeWPF.Services.Encode.Factories } task.SubtitleTracks.Add(null); - } } @@ -318,7 +317,7 @@ namespace HandBrakeWPF.Services.Encode.Factories if (deblockFilter != null) { var filterSettings = deblockFilter.Settings; - task.Deblock = filterSettings.Value<string>("qp").ToInt(); + task.DeblockPreset = null; // TODO Support Preset / Tune } // Sharpen diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index aec7219c2..5272810cd 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -81,7 +81,9 @@ namespace HandBrakeWPF.Services.Encode.Model this.CustomDetelecine = task.CustomDetelecine; this.CustomCombDetect = task.CustomCombDetect; this.CombDetect = task.CombDetect; - this.Deblock = task.Deblock; + this.DeblockPreset = task.DeblockPreset; + this.DeblockTune = task.DeblockTune; + this.CustomDeblock = task.CustomDeblock; this.DeinterlacePreset = task.DeinterlacePreset; this.DeinterlaceFilter = task.DeinterlaceFilter; this.Denoise = task.Denoise; @@ -327,11 +329,6 @@ namespace HandBrakeWPF.Services.Encode.Model public string CustomDenoise { get; set; } /// <summary> - /// Gets or sets Deblock. - /// </summary> - public int Deblock { get; set; } - - /// <summary> /// Gets or sets a value indicating whether Grayscale. /// </summary> public bool Grayscale { get; set; } @@ -350,6 +347,10 @@ namespace HandBrakeWPF.Services.Encode.Model public FilterPreset SharpenPreset { get; set; } public FilterTune SharpenTune { get; set; } public string SharpenCustom { get; set; } + + public FilterPreset DeblockPreset { get; set; } + public FilterTune DeblockTune { get; set; } + public string CustomDeblock { get; set; } #endregion #region Video diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 360cf7cab..c6dd9595e 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -102,7 +102,10 @@ namespace HandBrakeWPF.Services.Presets.Factories /* Filter Settings */
preset.Task.Grayscale = importedPreset.VideoGrayScale;
- preset.Task.Deblock = importedPreset.PictureDeblock;
+
+ preset.Task.DeblockPreset = new FilterPreset(HandBrakeFilterHelpers.GetFilterPresets((int)hb_filter_ids.HB_FILTER_DEBLOCK).FirstOrDefault(s => s.ShortName == importedPreset.PictureDeblockPreset));
+ preset.Task.DeblockTune = new FilterTune(HandBrakeFilterHelpers.GetFilterTunes((int)hb_filter_ids.HB_FILTER_DEBLOCK).FirstOrDefault(s => s.ShortName == importedPreset.PictureDeblockTune));
+ preset.Task.CustomDeblock = importedPreset.PictureDeblockCustom;
if (importedPreset.PictureSharpenFilter != null)
{
@@ -603,7 +606,9 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.PictureBottomCrop = export.Task.Cropping.Bottom;
// Filters
- preset.PictureDeblock = export.Task.Deblock;
+ preset.PictureDeblockPreset = export.Task.DeblockPreset?.Key;
+ preset.PictureDeblockTune = export.Task.DeblockTune?.Key;
+ preset.PictureDeblockCustom = export.Task.CustomDeblock;
preset.PictureDeinterlaceFilter = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb
? "decomb"
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index c54780042..52f1d5d7f 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -806,7 +806,6 @@ namespace HandBrakeWPF.Services.Presets this.Add(preset, true);
}
}
-
}
/// <summary>
|