summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-22 16:32:22 +0000
committersr55 <[email protected]>2015-01-22 16:32:22 +0000
commitacf831a1c78044a01e470102385334d183d1d5b1 (patch)
treef508c79182ff84f33617dcf826110bd21312adeb /win/CS/HandBrakeWPF
parent1ccc7a6a3caedda77d6e62972129727fb1598f35 (diff)
WinGui: Initial re-factoring of the Video Tab. Replaces encoder specific preset/tune/profile/level options with generic versions. This will break all existing user presets so the version number for the presets has been bumped. This should trigger the old presets to be archived.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6789 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs48
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs17
-rw-r--r--win/CS/HandBrakeWPF/Presets.dat26
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs30
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs59
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs1
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Model/PresetContainer.cs12
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs28
-rw-r--r--win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs759
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml130
12 files changed, 380 insertions, 734 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
index b488470e2..a0f2c78ed 100644
--- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
@@ -18,7 +18,6 @@ namespace HandBrakeWPF.Converters
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
@@ -47,19 +46,12 @@ namespace HandBrakeWPF.Converters
/// </returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- // Lists
- if (value is IEnumerable<x264Preset>)
- {
- return EnumHelper<x264Preset>.GetEnumDisplayValues(typeof(x264Preset));
- }
- if (value is IEnumerable<x264Profile>)
+ if (value == null)
{
- return EnumHelper<x264Profile>.GetEnumDisplayValues(typeof(x264Profile));
- }
- if (value is IEnumerable<x264Tune>)
- {
- return EnumHelper<x264Tune>.GetEnumDisplayValues(typeof(x264Tune));
+ return null;
}
+
+ // Lists
if (value is IEnumerable<VideoEncoder>)
{
return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
@@ -68,10 +60,6 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<Mixdown>.GetEnumDisplayValues(typeof(Mixdown));
}
- if (targetType == typeof(QsvPreset) || value.GetType() == typeof(QsvPreset))
- {
- return EnumHelper<QsvPreset>.GetDisplay((QsvPreset)value);
- }
if (value is IEnumerable<PresetPictureSettingsMode>)
{
return EnumHelper<PresetPictureSettingsMode>.GetEnumDisplayValues(typeof(PresetPictureSettingsMode));
@@ -102,18 +90,6 @@ namespace HandBrakeWPF.Converters
}
// Single Items
- if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
- {
- return EnumHelper<x264Preset>.GetDisplay((x264Preset)value);
- }
- if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
- {
- return EnumHelper<x264Profile>.GetDisplay((x264Profile)value);
- }
- if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
- {
- return EnumHelper<x264Tune>.GetDisplay((x264Tune)value);
- }
if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
{
return EnumHelper<VideoEncoder>.GetDisplay((VideoEncoder)value);
@@ -184,18 +160,6 @@ namespace HandBrakeWPF.Converters
/// </exception>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
- {
- return EnumHelper<x264Preset>.GetValue(value.ToString());
- }
- if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
- {
- return EnumHelper<x264Profile>.GetValue(value.ToString());
- }
- if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
- {
- return EnumHelper<x264Tune>.GetValue(value.ToString());
- }
if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
{
return EnumHelper<VideoEncoder>.GetValue(value.ToString());
@@ -204,10 +168,6 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<Mixdown>.GetValue(value.ToString());
}
- if (targetType == typeof(QsvPreset) || value.GetType() == typeof(QsvPreset))
- {
- return EnumHelper<QsvPreset>.GetValue(value.ToString());
- }
if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
{
return EnumHelper<PresetPictureSettingsMode>.GetValue(value.ToString());
diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
index 18b246510..a67fc9ad8 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs
@@ -13,11 +13,8 @@ namespace HandBrakeWPF.Converters.Video
using System.Globalization;
using System.Windows.Data;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
/// <summary>
/// The x 264 queue tooltip converter.
@@ -41,13 +38,13 @@ namespace HandBrakeWPF.Converters.Video
return task.AdvancedEncoderOptions;
}
- return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
- EnumHelper<x264Preset>.GetDisplay(task.X264Preset),
- EnumHelper<x264Tune>.GetDisplay(task.X264Tune),
- task.H264Profile,
- task.H264Level,
- string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,
- Environment.NewLine);
+ //return string.Format("Preset: {0}{5}Tune: {1}{5}Profile: {2}{5}Level: {3}{5}Extra Arguments: {4}{5}",
+ // EnumHelper<x264Preset>.GetDisplay(task.X264Preset),
+ // EnumHelper<x264Tune>.GetDisplay(task.X264Tune),
+ // task.H264Profile,
+ // task.H264Level,
+ // string.IsNullOrEmpty(task.ExtraAdvancedArguments) ? "None" : task.ExtraAdvancedArguments,
+ // Environment.NewLine);
}
return task != null ? task.AdvancedEncoderOptions.Trim() : string.Empty;
diff --git a/win/CS/HandBrakeWPF/Presets.dat b/win/CS/HandBrakeWPF/Presets.dat
index 45ceaacca..0edf6b02f 100644
--- a/win/CS/HandBrakeWPF/Presets.dat
+++ b/win/CS/HandBrakeWPF/Presets.dat
@@ -1,31 +1,31 @@
< Devices
- + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 -m --x264-preset fast --h264-profile baseline --h264-level 3.0
+ + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 -m --encoder-preset fast --encoder-profile baseline --encoder-level 3.0
- + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -I -X 320 -Y 240 --modulus 2 -m --x264-preset medium --h264-profile baseline --h264-level 1.3
+ + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -I -X 320 -Y 240 --modulus 2 -m --encoder-preset medium --encoder-profile baseline --encoder-level 1.3
- + iPhone & iPod touch: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 640 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1
+ + iPhone & iPod touch: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 640 --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 3.1
- + iPad: -e x264 -q 20.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1
+ + iPad: -e x264 -q 20.0 -r 30 --pfr -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 3.1
- + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500
+ + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 960 -Y 720 --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 3.1 -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500
- + AppleTV 2: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1
+ + AppleTV 2: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 3.1
- + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1920 -Y 1080 --decomb=fast --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.0
+ + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 -X 1920 -Y 1080 --decomb=fast --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 4.0
- + Android: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.0
+ + Android: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 --encoder-preset medium --encoder-profile main --encoder-level 3.0
- + Android Tablet: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1
+ + Android Tablet: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 --encoder-preset medium --encoder-profile main --encoder-level 3.1
- + Windows Phone 8: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1
+ + Windows Phone 8: -e x264 -q 22.0 -r 30 --pfr -a 1 -E ffaac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -X 1280 -Y 720 --modulus 2 --encoder-preset medium --encoder-profile main --encoder-level 3.1
>
< Regular
- + Normal: -e x264 -q 20.0 -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset veryfast --h264-profile main --h264-level 4.0
+ + Normal: -e x264 -q 20.0 -a 1 -E ffaac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --encoder-preset veryfast --encoder-profile main --encoder-level 4.0
- + High Profile: -e x264 -q 20.0 -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1
+ + High Profile: -e x264 -q 20.0 -a 1,1 -E ffaac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --encoder-preset medium --encoder-profile high --encoder-level 4.1
->
+> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs
index 5cd4db148..5892978cd 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistFactory.cs
@@ -1,5 +1,5 @@
// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="PlistUtility.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="PlistFactory.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>
@@ -9,10 +9,10 @@
namespace HandBrakeWPF.Services.Presets.Factories
{
+ using System.Linq;
using System.Text;
using System.Xml;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Utilities;
@@ -23,7 +23,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
/// <summary>
/// Plist Preset Converter
/// </summary>
- public class PlistUtility
+ public class PlistFactory
{
#region Export
@@ -199,21 +199,19 @@ namespace HandBrakeWPF.Services.Presets.Factories
AddEncodeElement(xmlWriter, "VideoFramerateMode", "string", parsed.FramerateMode.ToString().ToLower());
AddBooleanElement(xmlWriter, "VideoGrayScale", parsed.Grayscale);
AddEncodeElement(xmlWriter, "VideoQualitySlider", "real", parsed.Quality.ToString());
- AddEncodeElement(xmlWriter, "h264Level", "string", parsed.H264Level);
- AddEncodeElement(xmlWriter, "x264OptionExtra", "string", parsed.AdvancedEncoderOptions);
- AddEncodeElement(xmlWriter, "x264Preset", "string", parsed.X264Preset.ToString().ToLower());
- AddEncodeElement(xmlWriter, "h264Profile", "string", parsed.H264Profile.ToString().ToLower());
- string tune = parsed.X264Tune.ToString().ToLower();
- if (parsed.FastDecode)
- {
- tune = tune == "none" ? "fastdecode" : tune + ",fastdecode";
- }
- AddEncodeElement(xmlWriter, "x264Tune", "string", tune);
+
+ if (parsed.VideoPreset != null)
+ AddEncodeElement(xmlWriter, "VideoPreset", "string", parsed.VideoPreset.ShortName);
+ if (parsed.VideoLevel != null)
+ AddEncodeElement(xmlWriter, "VideoLevel", "string", parsed.VideoLevel.ShortName);
+ if (parsed.VideoProfile != null)
+ AddEncodeElement(xmlWriter, "VideoProfile", "string", parsed.VideoProfile.ShortName);
+ if (parsed.VideoTunes != null)
+ AddEncodeElement(xmlWriter, "VideoTune", "string", parsed.VideoTunes.Aggregate(string.Empty, (current, item) => string.IsNullOrEmpty(current) ? item.ShortName : "," + item.ShortName));
+
+ AddEncodeElement(xmlWriter, "VideoOptionExtra", "string", parsed.ExtraAdvancedArguments);
AddEncodeElement(xmlWriter, "x264UseAdvancedOptions", "integer", parsed.ShowAdvancedTab ? "1" : "0");
- AddEncodeElement(xmlWriter, "h265Profile", "string", parsed.H265Profile.ToString().ToLower());
- AddEncodeElement(xmlWriter, "x265Preset", "string", parsed.X265Preset.ToString().ToLower());
- AddEncodeElement(xmlWriter, "x265Tune", "string", parsed.X265Tune.ToString().ToLower());
int videoQualityType = 0;
if (parsed.VideoBitrate != null) videoQualityType = 1;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs
index 7a6e336e8..a98e63e6d 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/PlistPresetFactory.cs
@@ -15,13 +15,11 @@ namespace HandBrakeWPF.Services.Presets.Factories
using System.Globalization;
using System.Linq;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
+ using HandBrake.ApplicationServices.Services.Encode.Model.Models.Video;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
- using HandBrake.Interop.Model.Encoding.x265;
using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Model.Subtitles;
@@ -249,38 +247,25 @@ namespace HandBrakeWPF.Services.Presets.Factories
case "VideoTwoPass":
preset.Task.TwoPass = kvp.Value == 1;
break;
- case "x264OptionExtra":
- preset.Task.AdvancedEncoderOptions = kvp.Value;
+
+ case "VideoOptionExtra":
+ preset.Task.ExtraAdvancedArguments = kvp.Value;
break;
- case "x264Preset":
- preset.Task.X264Preset = EnumHelper<x264Preset>.GetValue(kvp.Value, true);
+ case "VideoLevel":
+ preset.Task.VideoLevel = new VideoLevel(kvp.Value, kvp.Value);
break;
- case "h264Profile":
- preset.Task.H264Profile = EnumHelper<x264Profile>.GetValue(kvp.Value, true);
+ case "VideoProfile":
+ preset.Task.VideoProfile = new VideoProfile(kvp.Value, kvp.Value);
break;
- case "x264Tune":
- string value = kvp.Value;
- if (value.Contains("fastdecode"))
+ case "VideoPreset":
+ preset.Task.VideoPreset = new VideoPreset(kvp.Value, kvp.Value);
+ break;
+ case "VideoTune":
+ string[] split = kvp.Value.ToString().Split(',');
+ foreach (var item in split)
{
- preset.Task.FastDecode = true;
- value = value.Replace("fastdecode", string.Empty).Replace(",", string.Empty);
+ preset.Task.VideoTunes.Add(new VideoTune(item, item));
}
- preset.Task.X264Tune = EnumHelper<x264Tune>.GetValue(value, true);
- break;
- case "h264Level":
- preset.Task.H264Level = kvp.Value;
- break;
- case "QsvPreset":
- preset.Task.QsvPreset = EnumHelper<QsvPreset>.GetValue(kvp.Value, true);
- break;
- case "h265Profile":
- preset.Task.H265Profile = EnumHelper<x265Profile>.GetValue(kvp.Value, true);
- break;
- case "x265Tune":
- preset.Task.X265Tune = EnumHelper<x265Tune>.GetValue(kvp.Value, true);
- break;
- case "x265Preset":
- preset.Task.X265Preset = EnumHelper<x265Preset>.GetValue(kvp.Value, true);
break;
// Chapter Markers Tab
@@ -288,21 +273,13 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.Task.IncludeChapterMarkers = kvp.Value == true;
break;
- // Advanced x264 tab
+ // Advanced tab
case "x264Option":
- if (preset.Task.VideoEncoder == VideoEncoder.X264) // TODO Temp fix until a better solution is found.
- {
- preset.Task.AdvancedEncoderOptions = kvp.Value;
- }
- break;
-
case "lavcOption":
- if (preset.Task.VideoEncoder != VideoEncoder.X264) // TODO Temp fix until a better solution is found.
- {
- preset.Task.AdvancedEncoderOptions = kvp.Value;
- }
+ preset.Task.AdvancedEncoderOptions = kvp.Value;
break;
+
// Preset Information
case "PresetBuildNumber":
preset.Version = kvp.Value;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
index e1b3d0e4d..1ea596ef7 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
@@ -11,7 +11,6 @@ namespace HandBrakeWPF.Services.Presets.Model
{
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrakeWPF.Model.Audio;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/PresetContainer.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/PresetContainer.cs
index be7e4afdc..f84f88b67 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Model/PresetContainer.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Model/PresetContainer.cs
@@ -9,8 +9,20 @@
namespace HandBrakeWPF.Services.Presets.Model
{
+ /// <summary>
+ /// The preset container.
+ /// </summary>
public class PresetContainer
{
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PresetContainer"/> class.
+ /// </summary>
+ /// <param name="version">
+ /// The version.
+ /// </param>
+ /// <param name="presets">
+ /// The presets.
+ /// </param>
public PresetContainer(int version, string presets)
{
Version = version;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index be8357f68..cb9e161b2 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -18,7 +18,6 @@ namespace HandBrakeWPF.Services.Presets
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
- using System.Windows.Forms;
using System.Xml.Serialization;
using HandBrake.ApplicationServices.Exceptions;
@@ -38,7 +37,7 @@ namespace HandBrakeWPF.Services.Presets
{
#region Private Variables
- private static readonly int CurrentPresetVersion = 1;
+ private static readonly int CurrentPresetVersion = 2;
/// <summary>
/// XML Serializer
@@ -310,12 +309,12 @@ namespace HandBrakeWPF.Services.Presets
Preset newPreset = new Preset
{
- Category = category,
- Name = presetName[0].Replace("+", string.Empty).Trim(),
- Version = VersionHelper.GetVersion(),
+ Category = category,
+ Name = presetName[0].Replace("+", string.Empty).Trim(),
+ Version = VersionHelper.GetVersion(),
Description = string.Empty, // Maybe one day we will populate this.
- IsBuildIn = true,
- UsePictureFilters = true,
+ IsBuildIn = true,
+ UsePictureFilters = true,
Task = QueryParserUtility.Parse(presetName[2])
};
@@ -374,8 +373,12 @@ namespace HandBrakeWPF.Services.Presets
/// <summary>
/// Check if the preset "name" exists in either Presets or UserPresets lists.
/// </summary>
- /// <param name="name">Name of the preset</param>
- /// <returns>True if found</returns>
+ /// <param name="name">
+ /// Name of the preset
+ /// </param>
+ /// <returns>
+ /// True if found
+ /// </returns>
public bool CheckIfPresetExists(string name)
{
return name == string.Empty || this.presets.Any(item => item.Name == name);
@@ -453,6 +456,7 @@ namespace HandBrakeWPF.Services.Presets
foreach (Preset preset in list)
{
preset.IsBuildIn = true;
+
// Older versions did not have this flag so explicitly make sure it is set.
this.presets.Add(preset);
}
@@ -519,9 +523,9 @@ namespace HandBrakeWPF.Services.Presets
string fileName = RecoverFromCorruptedPresetFile(this.userPresetFile);
this.errorService.ShowMessageBox(
"HandBrake is unable to load your user presets because they are from an older version of HandBrake. Your old presets file has been renamed so that it doesn't get loaded on next launch."
- + Environment.NewLine + Environment.NewLine + "Archived File: " + fileName,
- "Unable to load user presets.",
- MessageBoxButton.OK,
+ + Environment.NewLine + Environment.NewLine + "Archived File: " + fileName,
+ "Unable to load user presets.",
+ MessageBoxButton.OK,
MessageBoxImage.Exclamation);
return;
}
diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
index b2605e790..8ece8c41a 100644
--- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
+++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
@@ -21,9 +21,7 @@ namespace HandBrakeWPF.Startup
using Castle.Windsor;
using HandBrake.ApplicationServices;
- using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 523f07312..48bf428f9 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1746,7 +1746,7 @@ namespace HandBrakeWPF.ViewModels
if (!string.IsNullOrEmpty(filename))
{
- PlistUtility.Export(
+ PlistFactory.Export(
savefiledialog.FileName,
this.selectedPreset,
HandBrakeUtils.Build.ToString(CultureInfo.InvariantCulture));
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 7060530ef..9fe599fc2 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -14,19 +14,17 @@ namespace HandBrakeWPF.ViewModels
using System.ComponentModel;
using System.Globalization;
using System.Linq;
- using System.Windows;
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
+ using HandBrake.ApplicationServices.Services.Encode.Model.Models.Video;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
using HandBrake.Interop.Model.Encoding;
- using HandBrake.Interop.Model.Encoding.x264;
- using HandBrake.Interop.Model.Encoding.x265;
using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Properties;
@@ -34,112 +32,37 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.ViewModels.Interfaces;
+ using Clipboard = System.Windows.Clipboard;
+
/// <summary>
/// The Video View Model
/// </summary>
public class VideoViewModel : ViewModelBase, IVideoViewModel
{
/*
- * TODO
- * 1. Refactor the Video Encoder Preset/Tune/Level options to be generic instead of encoder specific.
- * 2. Model the UI Interactions in a better way.
- */
+ * Hard Code "None" in the Models for Tune.
+ * Test Everything */
#region Constants and Fields
- /// <summary>
- /// Same as source constant.
- /// </summary>
- private const string SameAsSource = "Same as source";
-
- /// <summary>
- /// The possible h264 levels.
- /// </summary>
- private static readonly List<string> Levels = new List<string> { "Auto", "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2" };
- /// <summary>
- /// Backing field for the user setting service.
- /// </summary>
+ private const string SameAsSource = "Same as source";
private readonly IUserSettingService userSettingService;
-
- /// <summary>
- /// The advanced encoder options command
- /// </summary>
private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;
- /// <summary>
- /// Backing field used to display / hide the x264 options
- /// </summary>
- private bool displayX264Options;
-
- /// <summary>
- /// Backing field used to display / hide the x265 options
- /// </summary>
- private bool displayX265Options;
-
- /// <summary>
- /// The display qsv options.
- /// </summary>
- private bool displayQSVOptions;
-
- /// <summary>
- /// Backing field used to display / hide the h264 options
- /// </summary>
- private bool displayEncoderOptions;
-
- /// <summary>
- /// The quality max.
- /// </summary>
+ private bool displayOptimiseOptions;
private int qualityMax;
-
- /// <summary>
- /// The quality min.
- /// </summary>
private int qualityMin;
-
- /// <summary>
- /// The show peak framerate.
- /// </summary>
private bool showPeakFramerate;
-
- /// <summary>
- /// The show peak framerate.
- /// </summary>
private int rf;
-
- /// <summary>
- /// The x264 preset value.
- /// </summary>
- private int x264PresetValue;
-
- /// <summary>
- /// The qsv preset value.
- /// </summary>
- private int qsvPresetValue;
-
- /// <summary>
- /// The can clear tracker.
- /// </summary>
private bool canClear;
-
- /// <summary>
- /// The use advanced tab.
- /// </summary>
private bool useAdvancedTab;
-
- /// <summary>
- /// The display framerate controls.
- /// </summary>
- private bool displayNonQSVControls;
-
- /// <summary>
- /// The x265 preset value.
- /// </summary>
- private int x265PresetValue;
-
- /// <summary>
- /// The display turbo first pass.
- /// </summary>
private bool displayTurboFirstPass;
+ private int videoPresetMaxValue;
+ private int? videoPresetValue;
+ private bool displayNonQsvControls;
+ private VideoTune videoTune;
+ private bool fastDecode;
+ private bool displayTuneControls;
#endregion
@@ -164,15 +87,10 @@ namespace HandBrakeWPF.ViewModels
this.IsConstantQuantity = true;
this.VideoEncoders = EnumHelper<VideoEncoder>.GetEnumList();
- X264Presets = new BindingList<x264Preset>(EnumHelper<x264Preset>.GetEnumList().ToList());
- QsvPresets = new BindingList<QsvPreset>(EnumHelper<QsvPreset>.GetEnumList().ToList());
- H264Profiles = EnumHelper<x264Profile>.GetEnumList();
- X264Tunes = EnumHelper<x264Tune>.GetEnumList().Where(t => t != x264Tune.Fastdecode);
- this.H264Levels = Levels;
-
- X265Presets = new BindingList<x265Preset>(EnumHelper<x265Preset>.GetEnumList().ToList());
- H265Profiles = EnumHelper<x265Profile>.GetEnumList();
- X265Tunes = EnumHelper<x265Tune>.GetEnumList();
+ this.VideoProfiles = new BindingList<VideoProfile>();
+ this.VideoTunes = new BindingList<VideoTune>();
+ this.VideoPresets = new BindingList<VideoPreset>();
+ this.VideoLevels = new BindingList<VideoLevel>();
this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;
}
@@ -219,7 +137,7 @@ namespace HandBrakeWPF.ViewModels
}
set
{
- if (!object.Equals(value, this.useAdvancedTab))
+ if (!Equals(value, this.useAdvancedTab))
{
// Set the Advanced Tab up with the current settings, if we can.
if (value)
@@ -560,38 +478,7 @@ namespace HandBrakeWPF.ViewModels
{
this.Task.VideoEncoder = value;
this.NotifyOfPropertyChange(() => this.SelectedVideoEncoder);
-
- // Tell the Advanced Panel off the change
- IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();
- advancedViewModel.SetEncoder(this.Task.VideoEncoder);
-
- // Update the Quality Slider. Make sure the bounds are up to date with the users settings.
- this.SetQualitySliderBounds();
-
- // Hide the x264 controls when not needed.
- this.DisplayX264Options = value == VideoEncoder.X264;
-
- // Hide the x265 controls when not needed.
- this.DisplayX265Options = value == VideoEncoder.X265;
-
- this.DisplayQSVOptions = value == VideoEncoder.QuickSync;
- this.DisplayH264Options = value == VideoEncoder.X264 || value == VideoEncoder.QuickSync;
- this.UseAdvancedTab = value != VideoEncoder.QuickSync && this.UseAdvancedTab;
- this.DisplayNonQSVControls = value != VideoEncoder.QuickSync;
- this.DisplayTurboFirstPass = value == VideoEncoder.X264;
-
- this.NotifyOfPropertyChange(() => this.Rfqp);
- this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
-
- this.NotifyOfPropertyChange(() => this.HighQualityLabel);
- if (value == VideoEncoder.QuickSync)
- {
- this.IsConstantFramerate = true;
- this.TwoPass = false;
- this.TurboFirstPass = false;
- this.Task.Framerate = null;
- this.NotifyOfPropertyChange(() => SelectedFramerate);
- }
+ HandleEncoderChange(this.Task.VideoEncoder);
}
}
@@ -627,7 +514,7 @@ namespace HandBrakeWPF.ViewModels
}
set
{
- if (!object.Equals(this.Task.ExtraAdvancedArguments, value))
+ if (!Equals(this.Task.ExtraAdvancedArguments, value))
{
this.Task.ExtraAdvancedArguments = value;
this.NotifyOfPropertyChange(() => this.ExtraArguments);
@@ -639,276 +526,245 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets or sets a value indicating whether to display H264
/// </summary>
- public bool DisplayH264Options
+ public bool DisplayOptimiseOptions
{
get
{
- return this.displayEncoderOptions;
+ return this.displayOptimiseOptions;
}
set
{
- this.displayEncoderOptions = value;
- this.NotifyOfPropertyChange(() => this.DisplayH264Options);
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether display x 264 options.
- /// </summary>
- public bool DisplayX264Options
- {
- get
- {
- return this.displayX264Options;
- }
- set
- {
- this.displayX264Options = value;
- this.NotifyOfPropertyChange(() => this.DisplayX264Options);
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether display x 264 options.
- /// </summary>
- public bool DisplayX265Options
- {
- get
- {
- return this.displayX265Options;
- }
- set
- {
- this.displayX265Options = value;
- this.NotifyOfPropertyChange(() => this.DisplayX265Options);
+ this.displayOptimiseOptions = value;
+ this.NotifyOfPropertyChange(() => this.DisplayOptimiseOptions);
this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
/// <summary>
- /// Gets or sets a value indicating whether to display qsv options.
- /// </summary>
- public bool DisplayQSVOptions
- {
- get
- {
- return this.displayQSVOptions;
- }
- set
- {
- this.displayQSVOptions = value;
- this.NotifyOfPropertyChange(() => this.DisplayQSVOptions);
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether display framerate controls.
+ /// Gets or sets a value indicating whether display non qsv controls.
/// </summary>
public bool DisplayNonQSVControls
+
{
get
{
- return this.displayNonQSVControls;
+ return this.displayNonQsvControls;
}
-
set
{
- this.displayNonQSVControls = value;
+ if (value.Equals(this.displayNonQsvControls))
+ {
+ return;
+ }
+ this.displayNonQsvControls = value;
this.NotifyOfPropertyChange(() => this.DisplayNonQSVControls);
}
}
/// <summary>
- /// Gets or sets the x 264 preset value.
+ /// Gets or sets a value indicating whether display tune controls.
/// </summary>
- public int X264PresetValue
+ public bool DisplayTuneControls
{
get
{
- return this.x264PresetValue;
+ return this.displayTuneControls;
}
set
{
- if (!object.Equals(this.X264PresetValue, value))
+ if (value.Equals(this.displayTuneControls))
{
- this.x264PresetValue = value;
- this.X264Preset = this.X264Presets[value];
- this.NotifyOfPropertyChange(() => this.x264PresetValue);
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ return;
}
+ this.displayTuneControls = value;
+ this.NotifyOfPropertyChange(() => this.DisplayTuneControls);
}
}
/// <summary>
- /// Gets or sets X264Preset.
+ /// Gets or sets a value indicating whether fast decode.
/// </summary>
- public x264Preset X264Preset
+ public bool FastDecode
{
get
{
- return this.Task.X264Preset;
+ return this.fastDecode;
}
set
{
- if (!object.Equals(this.X264Preset, value))
+ if (value.Equals(this.fastDecode))
{
- this.Task.X264Preset = value;
- this.NotifyOfPropertyChange(() => this.X264Preset);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ return;
+ }
+ this.fastDecode = value;
+ this.NotifyOfPropertyChange(() => this.FastDecode);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ ResetAdvancedTab();
+
+ // Update the encode task
+ if (value && !this.Task.VideoTunes.Contains(VideoTune.FastDecode))
+ {
+ this.Task.VideoTunes.Add(VideoTune.FastDecode);
}
+ else
+ {
+ this.Task.VideoTunes.Remove(VideoTune.FastDecode);
+ }
}
}
/// <summary>
- /// Gets or sets X264Preset.
+ /// Gets or sets the video preset.
/// </summary>
- public QsvPreset QsvPreset
+ public VideoPreset VideoPreset
{
get
{
- return this.Task.QsvPreset;
+ return this.Task.VideoPreset;
}
set
{
- if (!object.Equals(this.QsvPreset, value))
- {
- this.Task.QsvPreset = value;
- this.NotifyOfPropertyChange(() => this.QsvPreset);
- }
+ this.Task.VideoPreset = value;
+ this.NotifyOfPropertyChange(() => this.VideoPreset);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ ResetAdvancedTab();
}
}
/// <summary>
- /// Gets or sets the x 264 preset value.
+ /// Gets or sets the video preset value.
/// </summary>
- public int QsvPresetValue
+ public int? VideoPresetValue
{
get
{
- return this.qsvPresetValue;
+ return this.videoPresetValue;
}
set
{
- if (!object.Equals(this.QsvPresetValue, value))
+ this.videoPresetValue = value;
+
+ HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper<VideoEncoder>.GetShortName(this.SelectedVideoEncoder));
+ if (encoder != null && value.HasValue)
{
- this.qsvPresetValue = value;
- this.QsvPreset = this.QsvPresets[value];
- this.NotifyOfPropertyChange(() => this.QsvPresetValue);
+ string preset = encoder.Presets[value.Value];
+ this.VideoPreset = new VideoPreset(preset, preset);
}
+
+ this.NotifyOfPropertyChange(() => this.VideoPresetValue);
}
}
/// <summary>
- /// Gets or sets H264Profile.
+ /// Gets or sets the video preset max value.
/// </summary>
- public x264Profile H264Profile
+ public int VideoPresetMaxValue
{
get
{
- return this.Task.H264Profile;
+ return this.videoPresetMaxValue;
}
set
{
- if (!object.Equals(this.H264Profile, value))
+ if (value == this.videoPresetMaxValue)
{
- this.Task.H264Profile = value;
- this.NotifyOfPropertyChange(() => this.H264Profile);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ return;
}
+ this.videoPresetMaxValue = value;
+ this.NotifyOfPropertyChange(() => this.VideoPresetMaxValue);
}
}
/// <summary>
- /// Gets or sets H264Profile.
+ /// Gets or sets the video tune.
/// </summary>
- public string H264Level
+ public VideoTune VideoTune
{
get
{
- return this.Task.H264Level;
+ return this.videoTune;
}
set
{
- if (!object.Equals(this.H264Level, value))
+ if (Equals(value, this.videoTune))
{
- this.Task.H264Level = value;
- this.NotifyOfPropertyChange(() => this.H264Level);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ return;
+ }
+ this.videoTune = value;
+ this.NotifyOfPropertyChange(() => this.VideoTune);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ ResetAdvancedTab();
+
+ // Update the encode task.
+ this.Task.VideoTunes.Clear();
+ if (value != null && !Equals(value, VideoTune.None))
+ {
+ this.Task.VideoTunes.Add(value);
+ }
+
+ if (this.FastDecode)
+ {
+ this.Task.VideoTunes.Add(VideoTune.FastDecode);
}
}
}
/// <summary>
- /// Gets or sets X264Tune.
+ /// Gets or sets the video profile.
/// </summary>
- public x264Tune X264Tune
+ public VideoProfile VideoProfile
{
get
{
- return this.Task.X264Tune;
+ return this.Task.VideoProfile;
}
set
{
- if (!object.Equals(this.X264Tune, value))
- {
- this.Task.X264Tune = value;
- this.NotifyOfPropertyChange(() => this.X264Tune);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
+ this.Task.VideoProfile = value;
+ this.NotifyOfPropertyChange(() => this.VideoProfile);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ ResetAdvancedTab();
}
}
/// <summary>
- /// Gets or sets a value indicating whether fast decode.
+ /// Gets or sets the video level.
/// </summary>
- public bool FastDecode
+ public VideoLevel VideoLevel
{
get
{
- return this.Task.FastDecode;
+ return this.Task.VideoLevel;
}
set
{
- if (!object.Equals(this.FastDecode, value))
- {
- this.Task.FastDecode = value;
- this.NotifyOfPropertyChange(() => this.FastDecode);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
+ this.Task.VideoLevel = value;
+ this.NotifyOfPropertyChange(() => this.VideoLevel);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ ResetAdvancedTab();
}
}
/// <summary>
- /// Gets or sets X264Presets.
+ /// Gets or sets the video presets.
/// </summary>
- public BindingList<x264Preset> X264Presets { get; set; }
+ public BindingList<VideoPreset> VideoPresets { get; set; }
/// <summary>
- /// Gets or sets QsvPreset.
+ /// Gets or sets the video tunes.
/// </summary>
- public BindingList<QsvPreset> QsvPresets { get; set; }
+ public BindingList<VideoTune> VideoTunes { get; set; }
/// <summary>
- /// Gets or sets X264Profiles.
+ /// Gets or sets the video profiles.
/// </summary>
- public IEnumerable<x264Profile> H264Profiles { get; set; }
+ public BindingList<VideoProfile> VideoProfiles { get; set; }
/// <summary>
- /// Gets or sets X264Tunes.
+ /// Gets or sets the video levels.
/// </summary>
- public IEnumerable<x264Tune> X264Tunes { get; set; }
-
- /// <summary>
- /// Gets or sets the x 264 levels.
- /// </summary>
- public IEnumerable<string> H264Levels { get; set; }
+ public BindingList<VideoLevel> VideoLevels { get; set; }
/// <summary>
/// Gets the full options tooltip.
@@ -922,117 +778,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Gets the qsv slider max.
- /// </summary>
- public int QsvSliderMax
- {
- get
- {
- return SystemInfo.IsHswOrNewer ? 2 : 1;
- }
- }
-
- /// <summary>
- /// Gets or sets the x 265 preset value.
- /// </summary>
- public int X265PresetValue
- {
- get
- {
- return this.x265PresetValue;
- }
- set
- {
- if (!object.Equals(this.X265PresetValue, value))
- {
- this.x265PresetValue = value;
- this.X265Preset = this.X265Presets[value];
- this.NotifyOfPropertyChange(() => this.x265PresetValue);
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
- }
- }
-
- /// <summary>
- /// Gets or sets X265Preset.
- /// </summary>
- public x265Preset X265Preset
- {
- get
- {
- return this.Task.X265Preset;
- }
- set
- {
- if (!object.Equals(this.X265Preset, value))
- {
- this.Task.X265Preset = value;
- this.NotifyOfPropertyChange(() => this.X265Preset);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
- }
- }
-
- /// <summary>
- /// Gets or sets H265Profile.
- /// </summary>
- public x265Profile H265Profile
- {
- get
- {
- return this.Task.H265Profile;
- }
-
- set
- {
- if (!object.Equals(this.H265Profile, value))
- {
- this.Task.H265Profile = value;
- this.NotifyOfPropertyChange(() => this.H265Profile);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
- }
- }
-
- /// <summary>
- /// Gets or sets X265Tune.
- /// </summary>
- public x265Tune X265Tune
- {
- get
- {
- return this.Task.X265Tune;
- }
- set
- {
- if (!object.Equals(this.X265Tune, value))
- {
- this.Task.X265Tune = value;
- this.NotifyOfPropertyChange(() => this.X265Tune);
- ResetAdvancedTab();
- this.NotifyOfPropertyChange(() => FullOptionsTooltip);
- }
- }
- }
-
- /// <summary>
- /// Gets or sets X265Presets.
- /// </summary>
- public BindingList<x265Preset> X265Presets { get; set; }
-
- /// <summary>
- /// Gets or sets X265Profiles.
- /// </summary>
- public IEnumerable<x265Profile> H265Profiles { get; set; }
-
- /// <summary>
- /// Gets or sets X265Tunes.
- /// </summary>
- public IEnumerable<x265Tune> X265Tunes { get; set; }
-
- /// <summary>
/// Gets or sets a value indicating whether display turbo first pass.
/// </summary>
public bool DisplayTurboFirstPass
@@ -1123,60 +868,22 @@ namespace HandBrakeWPF.ViewModels
if (preset.Task != null)
{
- this.SetEncoder(preset.Task.VideoEncoder);
-
- // applies to both x264 and QSV
- if (preset.Task.VideoEncoder == VideoEncoder.X264 ||
- preset.Task.VideoEncoder == VideoEncoder.QuickSync)
- {
- this.H264Profile = preset.Task.H264Profile;
- this.H264Level = preset.Task.H264Level;
- }
- else
- {
- this.H264Profile = x264Profile.Auto;
- this.H264Level = "Auto";
- }
-
- // x264 Only
- if (preset.Task.VideoEncoder == VideoEncoder.X264)
- {
- this.X264PresetValue = (int)preset.Task.X264Preset;
- this.X264Tune = preset.Task.X264Tune;
- this.FastDecode = preset.Task.FastDecode;
- }
- else
- {
- this.X264PresetValue = (int)x264Preset.Medium;
- this.X264Tune = x264Tune.None;
- this.FastDecode = false;
- }
+ this.HandleEncoderChange(preset.Task.VideoEncoder);
- // x265 Only
- if (preset.Task.VideoEncoder == VideoEncoder.X265)
+ HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper<VideoEncoder>.GetShortName(preset.Task.VideoEncoder));
+ if (encoder != null)
{
- this.X265PresetValue = (int)preset.Task.X265Preset;
- this.X265Tune = preset.Task.X265Tune;
- this.H265Profile = preset.Task.H265Profile;
- }
- else
- {
- this.X265PresetValue = (int)x265Preset.VeryFast;
- this.X265Tune = x265Tune.None;
- this.H265Profile = x265Profile.None;
+ if (preset.Task.VideoEncoder == VideoEncoder.X264 || preset.Task.VideoEncoder == VideoEncoder.X265 || preset.Task.VideoEncoder == VideoEncoder.QuickSync)
+ {
+ this.VideoLevel = preset.Task.VideoLevel != null ? preset.Task.VideoLevel.Clone() : this.VideoLevels.FirstOrDefault();
+ this.VideoProfile = preset.Task.VideoProfile != null ? preset.Task.VideoProfile.Clone() : this.VideoProfiles.FirstOrDefault();
+ this.VideoPresetValue = preset.Task.VideoPreset != null ? this.VideoPresets.IndexOf(preset.Task.VideoPreset) : 0;
+ this.FastDecode = preset.Task.VideoTunes != null && preset.Task.VideoTunes.Contains(VideoTune.FastDecode);
+ this.VideoTune = preset.Task.VideoTunes != null ? preset.Task.VideoTunes.FirstOrDefault(t => !Equals(t, VideoTune.FastDecode)) : this.VideoTunes.FirstOrDefault();
+ }
}
- // QSV Only
- if (preset.Task.VideoEncoder == VideoEncoder.QuickSync)
- {
- this.QsvPresetValue = (int)preset.Task.QsvPreset;
- }
- else
- {
- this.QsvPresetValue = SystemInfo.IsHswOrNewer
- ? (int)QsvPreset.Quality
- : (int)QsvPreset.Balanced;
- }
+ // TODO Hide Controls.
this.ExtraArguments = preset.Task.ExtraAdvancedArguments;
this.UseAdvancedTab = !string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab;
@@ -1210,37 +917,12 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.Task.TwoPass);
this.NotifyOfPropertyChange(() => this.Task.TurboFirstPass);
- this.NotifyOfPropertyChange(() => this.X264Tune);
- this.NotifyOfPropertyChange(() => this.X264Preset);
- this.NotifyOfPropertyChange(() => this.H264Level);
- this.NotifyOfPropertyChange(() => this.H264Profile);
+ this.NotifyOfPropertyChange(() => this.VideoTune);
+ this.NotifyOfPropertyChange(() => this.VideoProfile);
+ this.NotifyOfPropertyChange(() => this.VideoProfile);
+ this.NotifyOfPropertyChange(() => this.VideoLevel);
this.NotifyOfPropertyChange(() => this.FastDecode);
this.NotifyOfPropertyChange(() => this.ExtraArguments);
- this.NotifyOfPropertyChange(() => this.QsvPreset);
-
- this.NotifyOfPropertyChange(() => this.H265Profile);
- this.NotifyOfPropertyChange(() => this.X265Preset);
- this.NotifyOfPropertyChange(() => this.X265Tune);
- }
-
- /// <summary>
- /// Set the currently selected encoder.
- /// </summary>
- /// <param name="encoder">
- /// The Video Encoder.
- /// </param>
- public void SetEncoder(VideoEncoder encoder)
- {
- this.DisplayH264Options = encoder == VideoEncoder.X264 || encoder == VideoEncoder.QuickSync;
- this.DisplayX264Options = encoder == VideoEncoder.X264;
- this.DisplayQSVOptions = encoder == VideoEncoder.QuickSync;
- this.DisplayX265Options = encoder == VideoEncoder.X265;
- this.DisplayTurboFirstPass = encoder == VideoEncoder.X264;
-
- if (encoder == VideoEncoder.QuickSync)
- {
- this.UseAdvancedTab = false;
- }
}
/// <summary>
@@ -1262,17 +944,15 @@ namespace HandBrakeWPF.ViewModels
public void ClearAdvancedSettings()
{
this.canClear = false;
- this.X264PresetValue = 5;
- this.X264Tune = x264Tune.None;
- this.H264Profile = x264Profile.Auto;
this.FastDecode = false;
- this.H264Level = "Auto";
+ this.VideoTune = null;
+ this.VideoProfile = new VideoProfile("auto", "auto");
+ this.VideoPreset = null;
+ this.VideoPresetValue = 1;
+ this.VideoLevel = new VideoLevel("auto", "auto");
+
this.ExtraArguments = string.Empty;
this.canClear = true;
-
- this.H265Profile = x265Profile.None;
- this.x265PresetValue = 1;
- this.X265Tune = x265Tune.None;
}
/// <summary>
@@ -1340,13 +1020,13 @@ namespace HandBrakeWPF.ViewModels
return string.Empty; // Feature is disabled.
}
- string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset).ToLower().Replace(" ", string.Empty);
- string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile).ToLower();
+ string preset = this.VideoPreset != null ? this.VideoPreset.ShortName : string.Empty;
+ string profile = this.VideoProfile != null ? this.VideoProfile.ShortName : string.Empty;
List<string> tunes = new List<string>();
- if (X264Tune != x264Tune.None)
+ if (this.VideoTune != null && this.VideoTune.ShortName != "none")
{
- tunes.Add(this.X264Tune.ToString().ToLower().Replace(" ", string.Empty)); // TODO tidy this sillyness up.
+ tunes.Add(this.VideoTune.ShortName);
}
if (this.FastDecode)
{
@@ -1370,12 +1050,12 @@ namespace HandBrakeWPF.ViewModels
try
{
return HandBrakeUtils.CreateX264OptionsString(
- preset,
- tunes,
- this.ExtraArguments,
- profile,
- this.H264Level,
- width,
+ preset,
+ tunes,
+ this.ExtraArguments,
+ profile,
+ this.VideoLevel != null ? this.VideoLevel.ShortName : string.Empty,
+ width,
height);
}
catch (Exception)
@@ -1393,7 +1073,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="e">
/// The e.
/// </param>
- private void UserSettingServiceSettingChanged(object sender, HandBrake.ApplicationServices.EventArgs.SettingChangedEventArgs e)
+ private void UserSettingServiceSettingChanged(object sender, SettingChangedEventArgs e)
{
if (e.Key == UserSettingConstants.ShowAdvancedTab)
{
@@ -1458,5 +1138,124 @@ namespace HandBrakeWPF.ViewModels
break;
}
}
+
+ /// <summary>
+ /// The handle encoder change.
+ /// </summary>
+ /// <param name="selectedEncoder">
+ /// The selected encoder.
+ /// </param>
+ private void HandleEncoderChange(VideoEncoder selectedEncoder)
+ {
+ HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper<VideoEncoder>.GetShortName(selectedEncoder));
+ if (encoder != null)
+ {
+ // Setup Profile
+ this.VideoProfiles.Clear();
+ if (encoder.Profiles != null)
+ {
+ foreach (var item in encoder.Profiles)
+ {
+ this.VideoProfiles.Add(new VideoProfile(item, item));
+ }
+ this.VideoProfile = this.VideoProfiles.FirstOrDefault();
+ }
+ else
+ {
+ this.VideoProfile = null;
+ }
+
+ // Setup Tune
+ this.VideoTunes.Clear();
+ if (encoder.Tunes != null)
+ {
+ this.VideoTunes.Add(VideoTune.None);
+ foreach (var item in encoder.Tunes)
+ {
+ if (item != VideoTune.FastDecode.ShortName)
+ {
+ this.VideoTunes.Add(new VideoTune(item, item));
+ }
+ }
+ this.FastDecode = false;
+ this.VideoTune = VideoTune.None;
+ }
+ else
+ {
+ this.FastDecode = false;
+ this.VideoTune = VideoTune.None;
+ }
+
+ // Setup Levels
+ this.VideoLevels.Clear();
+ if (encoder.Levels != null)
+ {
+ foreach (var item in encoder.Levels)
+ {
+ this.VideoLevels.Add(new VideoLevel(item, item));
+ }
+
+ this.VideoLevel = this.VideoLevels.FirstOrDefault();
+ }
+ else
+ {
+ this.VideoLevel = VideoLevel.Auto;
+ }
+
+
+ // Setup Presets.
+ this.VideoPresets.Clear();
+ if (encoder.Presets != null)
+ {
+ foreach (var item in encoder.Presets)
+ {
+ this.VideoPresets.Add(new VideoPreset(item, item));
+ }
+
+ this.VideoPresetMaxValue = encoder.Presets.Count - 1;
+ int middlePreset = (int)Math.Round((decimal)(this.VideoPresetMaxValue / 2), 0);
+ this.VideoPreset = new VideoPreset(encoder.Presets[middlePreset], encoder.Presets[middlePreset]);
+ }
+ else
+ {
+ this.VideoPreset = null;
+ }
+ }
+
+ // Tell the Advanced Panel off the change
+ IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();
+ advancedViewModel.SetEncoder(this.Task.VideoEncoder);
+
+ // Update the Quality Slider. Make sure the bounds are up to date with the users settings.
+ this.SetQualitySliderBounds();
+
+ if (this.SelectedVideoEncoder == VideoEncoder.X264 || this.SelectedVideoEncoder == VideoEncoder.X265 || this.SelectedVideoEncoder == VideoEncoder.QuickSync)
+ {
+ this.DisplayOptimiseOptions = true;
+ }
+
+ this.DisplayNonQSVControls = this.SelectedVideoEncoder != VideoEncoder.QuickSync;
+
+ // Update control display
+ this.UseAdvancedTab = selectedEncoder != VideoEncoder.QuickSync && this.UseAdvancedTab;
+ this.DisplayTurboFirstPass = selectedEncoder == VideoEncoder.X264;
+ this.DisplayTuneControls = SelectedVideoEncoder == VideoEncoder.X264;
+
+ // Refresh Display
+ this.NotifyOfPropertyChange(() => this.Rfqp);
+ this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
+ this.NotifyOfPropertyChange(() => this.HighQualityLabel);
+
+ // Handle some quicksync specific options.
+ if (selectedEncoder == VideoEncoder.QuickSync)
+ {
+ this.IsConstantFramerate = true;
+ this.TwoPass = false;
+ this.TurboFirstPass = false;
+ this.Task.Framerate = null;
+ this.NotifyOfPropertyChange(() => SelectedFramerate);
+ this.UseAdvancedTab = false;
+ }
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index 8e235ec5f..0de805316 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -151,60 +151,40 @@
<!-- Row 1 -->
- <TextBlock Text="x264 Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" />
- <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" >
- <Slider Minimum="0" Maximum="9" Width="150" Value="{Binding X264PresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
+ <TextBlock Text="Encoder Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
+ <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal" >
+ <Slider Minimum="0" Maximum="{Binding VideoPresetMaxValue}" Width="150" Value="{Binding VideoPresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_EncoderPreset}"
Style="{StaticResource LongToolTipHolder}" />
- <TextBlock Text="{Binding X264Preset, Converter={StaticResource enumComboConverter}}" Margin="5,0,0,0" />
+ <TextBlock Text="{Binding VideoPreset.DisplayName}" Margin="5,0,0,0" />
</StackPanel>
- <TextBlock Text="x264 Tune:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" />
+ <TextBlock Text="Encoder Tune:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"
+ Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>
<ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"
- ItemsSource="{Binding X264Tunes, Converter={StaticResource enumComboConverter}}"
- SelectedItem="{Binding X264Tune, Converter={StaticResource enumComboConverter}}"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}"
- ToolTip="{x:Static Properties:Resources.Video_EncoderTune}"
+ ItemsSource="{Binding VideoTunes}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoTune}"
+ ToolTip="{x:Static Properties:Resources.Video_EncoderTune}" Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"
Style="{StaticResource LongToolTipHolder}" />
<CheckBox IsChecked="{Binding FastDecode}" Content="Fast Decode" Grid.Row="2" Grid.Column="2" Margin="10,10,10,0" VerticalAlignment="Center"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}"
- ToolTip="{x:Static Properties:Resources.Video_x264FastDecode}"/>
-
- <TextBlock Text="QSV Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
- Visibility="{Binding DisplayQSVOptions, Converter={StaticResource boolToVisConverter}}" />
- <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
- Visibility="{Binding DisplayQSVOptions, Converter={StaticResource boolToVisConverter}}" >
- <Slider Minimum="0" Maximum="{Binding QsvSliderMax}" Width="150" Value="{Binding QsvPresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
- IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" />
- <TextBlock Text="{Binding QsvPreset, Converter={StaticResource enumComboConverter}}" Margin="5,0,0,0" />
- </StackPanel>
-
+ ToolTip="{x:Static Properties:Resources.Video_x264FastDecode}" Visibility="{Binding DisplayTuneControls, Converter={StaticResource boolToVisConverter}}"/>
+
<!-- Row 2-->
<TextBlock Text="H.264 Profile:" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" />
<ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"
- ItemsSource="{Binding H264Profiles, Converter={StaticResource enumComboConverter}}"
- SelectedItem="{Binding H264Profile, Converter={StaticResource enumComboConverter}}"
- Style="{StaticResource LongToolTipHolder}"
- ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
+ ItemsSource="{Binding VideoProfiles}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoProfile}"
+ Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
<TextBlock Text="H.264 Level:" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" />
<ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"
- ItemsSource="{Binding H264Levels}"
- SelectedItem="{Binding H264Level}"
- Style="{StaticResource LongToolTipHolder}"
- ToolTip="{x:Static Properties:Resources.Video_EncoderLevel}"/>
+ ItemsSource="{Binding VideoLevels}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoLevel}"
+ Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:Resources.Video_EncoderLevel}"/>
<!-- Row 3 -->
- <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" />
+ <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"
- ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}"
- Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" >
+ ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}" >
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Copy Full Query" cal:Message.Attach="[Event Click] = [Action CopyQuery]" />
@@ -217,84 +197,6 @@
</Grid>
- <!-- H265 settings -->
-
- <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="0,10,0,0" Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
- <TextBlock Text="Optimise Video:" Margin="0,0,0,8" Grid.Row="0" Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />
-
- <CheckBox Content="Use Advanced Tab instead" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
-
- <Grid Grid.Row="2" Margin="0,5,0,0" IsEnabled="{Binding UseAdvancedTab, Converter={StaticResource inverseConverter}}">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
-
- <!-- Row 1 -->
-
- <TextBlock Text="x265 Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
- <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" >
- <Slider Minimum="0" Maximum="9" Width="150" Value="{Binding X265PresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
- IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_EncoderPreset}"
- Style="{StaticResource LongToolTipHolder}" />
- <TextBlock Text="{Binding X265Preset}" Margin="5,0,0,0" />
- </StackPanel>
-
- <TextBlock Text="x265 Tune:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
- <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"
- ItemsSource="{Binding X265Tunes}"
- SelectedItem="{Binding X265Tune}"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}"
- ToolTip="{x:Static Properties:Resources.Video_EncoderTune}"
- Style="{StaticResource LongToolTipHolder}" />
-
- <TextBlock Text="H.265 Profile:" Grid.Row="2" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
- <ComboBox Width="100" Grid.Row="2" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}"
- ItemsSource="{Binding H265Profiles}"
- SelectedItem="{Binding H265Profile}"
- Style="{StaticResource LongToolTipHolder}"
- ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
-
- <!-- Row 3 -->
- <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
- <TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"
- ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}"
- Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" >
- <TextBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="Copy Full Query" cal:Message.Attach="[Event Click] = [Action CopyQuery]" />
- </ContextMenu>
- </TextBox.ContextMenu>
- </TextBox>
- </Grid>
- </Grid>
</Grid>
</Grid>