summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-09-21 22:12:56 +0000
committersr55 <[email protected]>2013-09-21 22:12:56 +0000
commita27b2c176c84d290339f3bb0dc5b9f9961817b30 (patch)
treea1b38d3c0bb432ec6fcb998d51dc32b397fe88ed /win/CS/HandBrakeWPF
parentab17c5c37fcc9a9f8a1617505b3131b9196f1549 (diff)
WinGui: Added a new tab in Options to host "Video" related settings including hardware acceleration. Only showing the QuickSync options. DXVA/OpenCl options are hidden for now.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5794 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs17
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs3
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs79
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs6
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj2
-rw-r--r--win/CS/HandBrakeWPF/Model/OptionsTab.cs3
-rw-r--r--win/CS/HandBrakeWPF/Model/VideoScaler.cs28
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs37
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx19
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs429
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml85
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml33
14 files changed, 583 insertions, 166 deletions
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
index d65b7f9f1..1d3a4e208 100644
--- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
@@ -19,6 +19,8 @@ namespace HandBrakeWPF.Converters
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrakeWPF.Model;
+
/// <summary>
/// Enum Combo Converter
/// </summary>
@@ -91,6 +93,11 @@ namespace HandBrakeWPF.Converters
return EnumHelper<Denoise>.GetEnumDisplayValues(typeof(Denoise));
}
+ if (value is IEnumerable<VideoScaler>)
+ {
+ return EnumHelper<VideoScaler>.GetEnumDisplayValues(typeof(VideoScaler));
+ }
+
// Single Items
@@ -140,6 +147,11 @@ namespace HandBrakeWPF.Converters
return EnumHelper<QueueItemStatus>.GetDisplay((QueueItemStatus)value);
}
+ if (targetType == typeof(VideoScaler) || value.GetType() == typeof(VideoScaler))
+ {
+ return EnumHelper<VideoScaler>.GetDisplay((VideoScaler)value);
+ }
+
return null;
}
@@ -190,7 +202,6 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<QsvPreset>.GetValue(value.ToString());
}
-
if (targetType == typeof(PresetPictureSettingsMode) || value.GetType() == typeof(PresetPictureSettingsMode))
{
return EnumHelper<PresetPictureSettingsMode>.GetValue(value.ToString());
@@ -211,6 +222,10 @@ namespace HandBrakeWPF.Converters
{
return EnumHelper<Detelecine>.GetValue(value.ToString());
}
+ if (targetType == typeof(VideoScaler) || value.GetType() == typeof(VideoScaler))
+ {
+ return EnumHelper<VideoScaler>.GetValue(value.ToString());
+ }
return null;
}
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
index 128596f3f..2911bb4fc 100644
--- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
@@ -53,6 +53,9 @@ namespace HandBrakeWPF.Converters.Options
case OptionsTab.About:
if ((OptionsTab)parameter == OptionsTab.About) return Visibility.Visible;
break;
+ case OptionsTab.Video:
+ if ((OptionsTab)parameter == OptionsTab.Video) return Visibility.Visible;
+ break;
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs
new file mode 100644
index 000000000..1eeedd653
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs
@@ -0,0 +1,79 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ScalingConverter.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>
+// Scaling Converter
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Video
+{
+ using System;
+ using System.Globalization;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// Video Scaling Converter
+ /// </summary>
+ public class ScalingConverter : IValueConverter
+ {
+ /// <summary>
+ /// The convert.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ return EnumHelper<VideoScaler>.GetDisplay((VideoScaler)value);
+ }
+
+ return VideoScaler.Lanczos;
+ }
+
+ /// <summary>
+ /// The convert back.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ /// <exception cref="NotImplementedException">
+ /// Not Required.
+ /// </exception>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
index e7f76f813..594f2c912 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
@@ -15,8 +15,11 @@ namespace HandBrakeWPF.Converters.Video
using System.Linq;
using System.Windows.Data;
+ using Caliburn.Micro;
+
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
@@ -55,7 +58,8 @@ namespace HandBrakeWPF.Converters.Video
encoders.Remove(VideoEncoder.Theora);
}
- if (!SystemInfo.IsQsvAvailable)
+ IUserSettingService userSettingService = IoC.Get<IUserSettingService>();
+ if (!SystemInfo.IsQsvAvailable || !userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSync))
{
encoders.Remove(VideoEncoder.QuickSync);
}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 66eb70257..02b1f0bc7 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -135,6 +135,8 @@
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Controls\SplitButton\SplitMenuButton.cs" />
+ <Compile Include="Converters\Video\ScalingConverter.cs" />
+ <Compile Include="Model\VideoScaler.cs" />
<Compile Include="ViewModels\CountdownAlertViewModel.cs" />
<Compile Include="ViewModels\Interfaces\ICountdownAlertViewModel.cs" />
<Compile Include="Views\CountdownAlertView.xaml.cs">
diff --git a/win/CS/HandBrakeWPF/Model/OptionsTab.cs b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
index 93692d13d..e895b6159 100644
--- a/win/CS/HandBrakeWPF/Model/OptionsTab.cs
+++ b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
@@ -25,6 +25,9 @@ namespace HandBrakeWPF.Model
[Display(Name = "Audio and Subtitles")]
AudioAndSubtitles,
+ [Display(Name = "Video")]
+ Video,
+
[Display(Name = "Advanced")]
Advanced,
diff --git a/win/CS/HandBrakeWPF/Model/VideoScaler.cs b/win/CS/HandBrakeWPF/Model/VideoScaler.cs
new file mode 100644
index 000000000..53ff3eb1b
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/VideoScaler.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="VideoScaler.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The different scaling modes available in HandBrake
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The different scaling modes available in HandBrake
+ /// </summary>
+ public enum VideoScaler
+ {
+ [Display(Name = "Lanczos")]
+ Lanczos = 0,
+
+ [Display(Name = "Bicubic")]
+ Bicubic,
+
+ [Display(Name = "Bicubic (OpenCL)")]
+ BicubicCl,
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 7dd8fdcf3..322d15fb6 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -384,6 +384,16 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Please note, this option is suitable only for slower systems.
+ ///Hardware decoders are designed for playback, not for re-encoding video so will likely bottleneck on faster systems..
+ /// </summary>
+ public static string Video_DxvaDecode {
+ get {
+ return ResourceManager.GetString("Video_DxvaDecode", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Higher Quality |.
/// </summary>
public static string Video_HigherQuality {
@@ -452,6 +462,33 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to QuickSync hardware not detected!
+ ///
+ ///In order to use the QuickSync encoder, you must:
+ ///
+ ///- Have a Intel Core series CPU with HD Graphics.
+ ///- Have a monitor connected to the HD Graphics
+ ///- Note in multi-GPU enviroments, there may be workarounds but these are not officially supported..
+ /// </summary>
+ public static string Video_QuickSyncNotAvailable {
+ get {
+ return ResourceManager.GetString("Video_QuickSyncNotAvailable", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.
+ ///Bicubic - Bicubic is faster but quality may not be as good. Video may not appear as soft and as a result file sizes may be larger
+ ///Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler.
+ /// This can be around 5~7% faster than software bicubic on a fast modern graphics card..
+ /// </summary>
+ public static string Video_ScalingModes {
+ get {
+ return ResourceManager.GetString("Video_ScalingModes", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to The full x264 list of parameters:
///{0}.
/// </summary>
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 2fd4015ed..08164ecdb 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -350,4 +350,23 @@ If you do not use this tab, it can be hidden from: Tools Menu &gt; Options &gt;
<data name="Video_PlaceboQuality" xml:space="preserve">
<value>Placebo Quality |</value>
</data>
+ <data name="Video_DxvaDecode" xml:space="preserve">
+ <value>Please note, this option is suitable only for slower systems.
+Hardware decoders are designed for playback, not for re-encoding video so will likely bottleneck on faster systems.</value>
+ </data>
+ <data name="Video_QuickSyncNotAvailable" xml:space="preserve">
+ <value>QuickSync hardware not detected!
+
+In order to use the QuickSync encoder, you must:
+
+- Have a Intel Core series CPU with HD Graphics.
+- Have a monitor connected to the HD Graphics
+- Note in multi-GPU enviroments, there may be workarounds but these are not officially supported.</value>
+ </data>
+ <data name="Video_ScalingModes" xml:space="preserve">
+ <value>Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.
+Bicubic - Bicubic is faster but quality may not be as good. Video may not appear as soft and as a result file sizes may be larger
+Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler.
+ This can be around 5~7% faster than software bicubic on a fast modern graphics card.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs
index e841005b2..91c34e818 100644
--- a/win/CS/HandBrakeWPF/UserSettingConstants.cs
+++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs
@@ -236,6 +236,11 @@ namespace HandBrakeWPF
/// </summary>
public const string ResetWhenDoneAction = "ResetWhenDoneAction";
+ /// <summary>
+ /// The enable quick sync.
+ /// </summary>
+ public const string EnableQuickSync = "EnableQuickSync";
+
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 819609f20..f1acf2624 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1341,7 +1341,8 @@ namespace HandBrakeWPF.ViewModels
QueryGeneratorUtility.GenerateQuery(this.CurrentTask,
userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount),
userSettingService.GetUserSetting<int>(ASUserSettingConstants.Verbosity),
- userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav)),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableLibDvdNav),
+ userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding)),
"CLI Query",
MessageBoxButton.OK,
MessageBoxImage.Information);
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 1ad006447..e6d47241f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -358,6 +358,23 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private bool resetWhenDoneAction;
+ /// <summary>
+ /// The selected scaling mode.
+ /// </summary>
+ private VideoScaler selectedScalingMode;
+
+ /// <summary>
+ /// The enable dxva decoding.
+ /// </summary>
+ private bool enableDxvaDecoding;
+
+ /// <summary>
+ /// The disable quick sync decoding.
+ /// </summary>
+ private bool disableQuickSyncDecoding;
+
+ private bool enableQuickSync;
+
#endregion
#region Constructors and Destructors
@@ -1390,6 +1407,106 @@ namespace HandBrakeWPF.ViewModels
#endregion
+ #region Video
+
+ /// <summary>
+ /// Gets or sets a value indicating whether enable quick sync.
+ /// </summary>
+ public bool EnableQuickSync
+ {
+ get
+ {
+ return this.enableQuickSync;
+ }
+ set
+ {
+ if (value.Equals(this.enableQuickSync))
+ {
+ return;
+ }
+ this.enableQuickSync = value;
+ this.NotifyOfPropertyChange(() => this.EnableQuickSync);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether disable quick sync decoding.
+ /// </summary>
+ public bool DisableQuickSyncDecoding
+ {
+ get
+ {
+ return this.disableQuickSyncDecoding;
+ }
+ set
+ {
+ if (value.Equals(this.disableQuickSyncDecoding))
+ {
+ return;
+ }
+ this.disableQuickSyncDecoding = value;
+ this.NotifyOfPropertyChange(() => this.DisableQuickSyncDecoding);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether enable dxva decoding.
+ /// </summary>
+ public bool EnableDxvaDecoding
+ {
+ get
+ {
+ return this.enableDxvaDecoding;
+ }
+ set
+ {
+ if (value.Equals(this.enableDxvaDecoding))
+ {
+ return;
+ }
+ this.enableDxvaDecoding = value;
+ this.NotifyOfPropertyChange(() => this.EnableDxvaDecoding);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the selected scaling mode.
+ /// </summary>
+ public VideoScaler SelectedScalingMode
+ {
+ get
+ {
+ return this.selectedScalingMode;
+ }
+ set
+ {
+ this.selectedScalingMode = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether is quick sync available.
+ /// </summary>
+ public bool IsQuickSyncAvailable
+ {
+ get
+ {
+ return SystemInfo.IsQsvAvailable;
+ }
+ }
+
+ /// <summary>
+ /// Gets the scaling options.
+ /// </summary>
+ public BindingList<VideoScaler> ScalingOptions
+ {
+ get
+ {
+ return new BindingList<VideoScaler>(EnumHelper<VideoScaler>.GetEnumList().ToList());
+ }
+ }
+ #endregion
+
#endregion
#region About HandBrake
@@ -1467,6 +1584,151 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Close this window.
+ /// </summary>
+ public void Close()
+ {
+ this.Save();
+ this.shellViewModel.DisplayWindow(ShellWindow.MainWindow);
+ }
+
+ /// <summary>
+ /// Browse - Send File To
+ /// </summary>
+ public void BrowseSendFileTo()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.*)|*.*" };
+ dialog.ShowDialog();
+ this.SendFileTo = Path.GetFileNameWithoutExtension(dialog.FileName);
+ this.sendFileToPath = dialog.FileName;
+ }
+
+ /// <summary>
+ /// Browse Auto Name Path
+ /// </summary>
+ public void BrowseAutoNamePath()
+ {
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
+ dialog.ShowDialog();
+ this.AutoNameDefaultPath = dialog.SelectedPath;
+ }
+
+ /// <summary>
+ /// Browse VLC Path
+ /// </summary>
+ public void BrowseVlcPath()
+ {
+ VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.exe)|*.exe" };
+ dialog.ShowDialog();
+ this.VLCPath = dialog.FileName;
+ }
+
+ /// <summary>
+ /// Audio List Move Left
+ /// </summary>
+ public void LanguageMoveRight()
+ {
+ if (this.SelectedAvailableToMove.Count > 0)
+ {
+ List<string> copiedList = SelectedAvailableToMove.ToList();
+ foreach (string item in copiedList)
+ {
+ this.AvailableLanguages.Remove(item);
+ this.SelectedLangauges.Add(item);
+ }
+
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+ }
+ }
+
+ /// <summary>
+ /// Audio List Move Right
+ /// </summary>
+ public void LanguageMoveLeft()
+ {
+ if (this.SelectedLangaugesToMove.Count > 0)
+ {
+ List<string> copiedList = SelectedLangaugesToMove.ToList();
+ foreach (string item in copiedList)
+ {
+ this.SelectedLangauges.Remove(item);
+ this.AvailableLanguages.Add(item);
+ }
+ }
+
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+ }
+
+ /// <summary>
+ /// Audio List Clear all selected languages
+ /// </summary>
+ public void LanguageClearAll()
+ {
+ foreach (string item in this.SelectedLangauges)
+ {
+ this.AvailableLanguages.Add(item);
+ }
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+
+ this.SelectedLangauges.Clear();
+ }
+
+ /// <summary>
+ /// Browse - Log Path
+ /// </summary>
+ public void BrowseLogPath()
+ {
+ VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
+ dialog.ShowDialog();
+ this.LogDirectory = dialog.SelectedPath;
+ }
+
+ /// <summary>
+ /// View the Default Log Directory for HandBrake
+ /// </summary>
+ public void ViewLogDirectory()
+ {
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
+ string windir = Environment.GetEnvironmentVariable("WINDIR");
+ Process prc = new Process { StartInfo = { FileName = windir + @"\explorer.exe", Arguments = logDir } };
+ prc.Start();
+ }
+
+ /// <summary>
+ /// Clear HandBrakes log directory.
+ /// </summary>
+ public void ClearLogHistory()
+ {
+ MessageBoxResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",
+ MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
+ if (result == MessageBoxResult.Yes)
+ {
+ GeneralUtilities.ClearLogFiles(0);
+ MessageBox.Show("HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+
+ /// <summary>
+ /// Download an Update
+ /// </summary>
+ public void DownloadUpdate()
+ {
+ this.UpdateMessage = "Preparing for Update ...";
+ this.updateService.DownloadFile(this.updateInfo.DownloadFile, this.DownloadComplete, this.DownloadProgress);
+ }
+
+ /// <summary>
+ /// Check for updates
+ /// </summary>
+ public void PerformUpdateCheck()
+ {
+ this.UpdateMessage = "Checking for Updates ...";
+ this.updateService.CheckForUpdates(this.UpdateCheckComplete);
+ }
+
+ #endregion
+
+ /// <summary>
/// Load User Settings
/// </summary>
public override void OnLoad()
@@ -1492,7 +1754,7 @@ namespace HandBrakeWPF.ViewModels
case 7:
this.CheckForUpdatesFrequency = 1;
break;
- case 30:
+ default:
this.CheckForUpdatesFrequency = 2;
break;
}
@@ -1615,6 +1877,15 @@ namespace HandBrakeWPF.ViewModels
this.AddClosedCaptions = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption);
this.ShowAdvancedPassthruOpts = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
+
+ // #############################
+ // Video
+ // #############################
+ this.EnableQuickSync = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableQuickSync);
+ this.DisableQuickSyncDecoding = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.DisableQuickSyncDecoding);
+ this.EnableDxvaDecoding = this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.EnableDxva);
+ this.SelectedScalingMode = this.userSettingService.GetUserSetting<VideoScaler>(ASUserSettingConstants.ScalingMode);
+
// #############################
// CLI
// #############################
@@ -1692,154 +1963,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Close this window.
- /// </summary>
- public void Close()
- {
- this.Save();
- this.shellViewModel.DisplayWindow(ShellWindow.MainWindow);
- }
-
- /// <summary>
- /// Browse - Send File To
- /// </summary>
- public void BrowseSendFileTo()
- {
- VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.*)|*.*" };
- dialog.ShowDialog();
- this.SendFileTo = Path.GetFileNameWithoutExtension(dialog.FileName);
- this.sendFileToPath = dialog.FileName;
- }
-
- /// <summary>
- /// Browse Auto Name Path
- /// </summary>
- public void BrowseAutoNamePath()
- {
- VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
- dialog.ShowDialog();
- this.AutoNameDefaultPath = dialog.SelectedPath;
- }
-
- /// <summary>
- /// Browse VLC Path
- /// </summary>
- public void BrowseVlcPath()
- {
- VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "All files (*.exe)|*.exe" };
- dialog.ShowDialog();
- this.VLCPath = dialog.FileName;
- }
-
- /// <summary>
- /// Audio List Move Left
- /// </summary>
- public void LanguageMoveRight()
- {
- if (this.SelectedAvailableToMove.Count > 0)
- {
- List<string> copiedList = SelectedAvailableToMove.ToList();
- foreach (string item in copiedList)
- {
- this.AvailableLanguages.Remove(item);
- this.SelectedLangauges.Add(item);
- }
-
- this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
- }
- }
-
- /// <summary>
- /// Audio List Move Right
- /// </summary>
- public void LanguageMoveLeft()
- {
- if (this.SelectedLangaugesToMove.Count > 0)
- {
- List<string> copiedList = SelectedLangaugesToMove.ToList();
- foreach (string item in copiedList)
- {
- this.SelectedLangauges.Remove(item);
- this.AvailableLanguages.Add(item);
- }
- }
-
- this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
- }
-
- /// <summary>
- /// Audio List Clear all selected languages
- /// </summary>
- public void LanguageClearAll()
- {
- foreach (string item in this.SelectedLangauges)
- {
- this.AvailableLanguages.Add(item);
- }
- this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
-
- this.SelectedLangauges.Clear();
- }
-
- /// <summary>
- /// Browse - Log Path
- /// </summary>
- public void BrowseLogPath()
- {
- VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };
- dialog.ShowDialog();
- this.LogDirectory = dialog.SelectedPath;
- }
-
- /// <summary>
- /// View the Default Log Directory for HandBrake
- /// </summary>
- public void ViewLogDirectory()
- {
- string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
- string windir = Environment.GetEnvironmentVariable("WINDIR");
- Process prc = new Process { StartInfo = { FileName = windir + @"\explorer.exe", Arguments = logDir } };
- prc.Start();
- }
-
- /// <summary>
- /// Clear HandBrakes log directory.
- /// </summary>
- public void ClearLogHistory()
- {
- MessageBoxResult result = MessageBox.Show("Are you sure you wish to clear the log file directory?", "Clear Logs",
- MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
- if (result == MessageBoxResult.Yes)
- {
- GeneralUtilities.ClearLogFiles(0);
- MessageBox.Show("HandBrake's Log file directory has been cleared!", "Notice", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- }
- #endregion
-
- #region Updates
-
- /// <summary>
- /// Download an Update
- /// </summary>
- public void DownloadUpdate()
- {
- this.UpdateMessage = "Preparing for Update ...";
- this.updateService.DownloadFile(this.updateInfo.DownloadFile, this.DownloadComplete, this.DownloadProgress);
- }
-
- /// <summary>
- /// Check for updates
- /// </summary>
- public void PerformUpdateCheck()
- {
- this.UpdateMessage = "Checking for Updates ...";
- this.updateService.CheckForUpdates(this.UpdateCheckComplete);
- }
-
- #endregion
-
- /// <summary>
/// Save the settings selected
/// </summary>
private void Save()
@@ -1880,6 +2003,14 @@ namespace HandBrakeWPF.ViewModels
this.userSettingService.SetUserSetting(UserSettingConstants.DubModeSubtitle, this.SelectedAddSubtitleMode);
this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedAudioPassthruOpts, this.ShowAdvancedPassthruOpts);
+
+ /* Video */
+ this.userSettingService.SetUserSetting(UserSettingConstants.EnableQuickSync, this.EnableQuickSync);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.DisableQuickSyncDecoding, this.DisableQuickSyncDecoding);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.EnableDxva, this.EnableDxvaDecoding);
+ this.userSettingService.SetUserSetting(ASUserSettingConstants.ScalingMode, this.SelectedScalingMode);
+
+
/* System and Logging */
userSettingService.SetUserSetting(ASUserSettingConstants.ProcessPriority, this.SelectedPriority);
userSettingService.SetUserSetting(UserSettingConstants.PreventSleep, this.PreventSleep);
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index 22058e0fb..df7edf4e8 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -4,6 +4,8 @@
xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" xmlns:local="clr-namespace:HandBrakeWPF.Model"
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ xmlns:video="clr-namespace:HandBrakeWPF.Converters.Video"
Style="{StaticResource whiteUserControlStyle}">
<UserControl.Resources>
@@ -34,7 +36,8 @@
<Options:OptionsTabConverter x:Key="tabConverter" />
<Options:OptionsTabNameConverter x:Key="tabNameConverter" />
-
+ <Converters:EnumComboConverter x:Key="enumComboConverter" />
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
<ObjectDataProvider MethodName="GetValues"
@@ -99,7 +102,7 @@
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
<StackPanel Orientation="Horizontal">
<ComboBox Name="whenDone" ItemsSource="{Binding WhenDoneOptions}" SelectedItem="{Binding WhenDone}" Width="120" HorizontalAlignment="Left" />
-
+
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
@@ -201,8 +204,8 @@
<StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"
Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">
-
-
+
+
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Audio and Subtitle Language Handling" FontSize="16" />
</Border>
@@ -228,7 +231,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
-
+
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
@@ -243,7 +246,7 @@
ItemsSource="{Binding AddAudioModeOptions}" SelectedIndex="{Binding SelectedAddAudioMode}" Width="120" Margin="0,0,5,0" />
<CheckBox Content="Add only one audio track per language" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left"
IsChecked="{Binding AddOnlyOneAudioTrackPerLanguage}" Margin="0,5,0,0" />
-
+
<!-- Subtitles -->
<TextBlock Text="Subtitle:" Grid.Column="2" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<ComboBox Name="autoSubtitleMode" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Left"
@@ -276,7 +279,7 @@
<DockPanel Grid.Column="1" Margin="10,0,10,0">
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" MaxWidth="90" />
- <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
+ <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
<Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
</StackPanel>
</DockPanel>
@@ -301,7 +304,63 @@
</StackPanel>
- <StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
+ <StackPanel Name="Hardware" Orientation="Vertical" Margin="10,10,0,0"
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Video}}">
+
+ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
+ <TextBlock Text="Video" FontSize="16" />
+ </Border>
+
+ <StackPanel Orientation="Vertical" Margin="0,10,0,20">
+
+ <TextBlock Text="Decoding" FontSize="14" Margin="0,10,0,10" Visibility="Collapsed" />
+
+ <StackPanel Orientation="Vertical" Margin="20,0,0,0" Visibility="Collapsed" >
+ <CheckBox Content="Enable DXVA Hardware Accelerated Decoding" IsChecked="{Binding EnableDxvaDecoding}" />
+
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical" Margin="37,2,0,0" Visibility="Collapsed" >
+ <TextBlock Text="{x:Static Properties:Resources.Video_DxvaDecode}" />
+ </StackPanel>
+
+
+ <TextBlock Text="Scaling" FontSize="14" Margin="0,20,0,10" Visibility="Collapsed" />
+
+ <StackPanel Orientation="Horizontal" Margin="20,0,0,0" Visibility="Collapsed">
+ <TextBlock Text="Choose Scaler: " Margin="0,0,5,0" VerticalAlignment="Center" />
+ <ComboBox ItemsSource="{Binding ScalingOptions, Converter={StaticResource enumComboConverter}}"
+ SelectedItem="{Binding SelectedScalingMode, Converter={StaticResource enumComboConverter}}"
+ Width="120" VerticalAlignment="Center" />
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical" Margin="26,2,0,0" Visibility="Collapsed" >
+ <TextBlock Text="{x:Static Properties:Resources.Video_ScalingModes}" TextWrapping="Wrap "/>
+ </StackPanel>
+
+
+
+ <TextBlock Text="Intel QuickSync" FontSize="14" Margin="0,20,0,10"/>
+
+ <StackPanel Orientation="Vertical" Margin="20,0,0,0">
+ <CheckBox Content="Enable the QuickSync Video Encoder" IsEnabled="{Binding IsQuickSyncAvailable}" IsChecked="{Binding EnableQuickSync}" />
+ <CheckBox Content="Disable QuickSync Decoding" IsEnabled="{Binding IsQuickSyncAvailable}" IsChecked="{Binding DisableQuickSyncDecoding}" />
+ </StackPanel>
+
+ <StackPanel Orientation="Vertical" Margin="37,2,0,0">
+ <TextBlock Text="{x:Static Properties:Resources.Video_QuickSyncNotAvailable}"
+ Visibility="{Binding IsQuickSyncAvailable, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"/>
+ </StackPanel>
+
+
+
+
+ </StackPanel>
+
+
+ </StackPanel>
+
+ <StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Advanced}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -379,13 +438,11 @@
<StackPanel Orientation="Vertical" Margin="0,10,0,20">
- <TextBlock Text="Experimental Features" Grid.Column="0" FontSize="14" Margin="0,0,0,10"/>
-
- <TextBlock Text="These options are for developer testing of features that are currently in progress!!!!" FontWeight="Bold" Margin="0,0,0,10" />
+ <TextBlock Text="Beta Features" Grid.Column="0" FontSize="14" Margin="0,0,0,10"/>
<StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
-
- <CheckBox Content="Enable LibHB based Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
+
+ <CheckBox Content="Use LibHB for Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
<CheckBox Content="Enable Process Isolation (Run Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
<TextBlock Text="Server Port:" VerticalAlignment="Center" />
@@ -423,7 +480,7 @@
<Button Content="Check for Updates" MaxWidth="130" Margin="0,0,5,0" cal:Message.Attach="[Event Click] = [Action PerformUpdateCheck]" />
<Button Content="Download Update" Width="120" cal:Message.Attach="[Event Click] = [Action DownloadUpdate]" Visibility="{Binding UpdateAvailable, Converter={StaticResource boolToVisConverter}}" />
</StackPanel>
-
+
<StackPanel Margin="20,10,0,0" Orientation="Horizontal">
<ProgressBar Minimum="0" Maximum="100" Height="20" Width="400" Value="{Binding DownloadProgressPercentage}"
Visibility="{Binding UpdateAvailable, Converter={StaticResource boolToVisConverter}}" />
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml
index 7ce82ef26..a175b9208 100644
--- a/win/CS/HandBrakeWPF/defaultsettings.xml
+++ b/win/CS/HandBrakeWPF/defaultsettings.xml
@@ -456,4 +456,37 @@
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
</value>
</item>
+
+ <item>
+ <key>
+ <string>EnableQuickSync</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">true</anyType>
+ </value>
+ </item>
+ <item>
+ <key>
+ <string>DisableQuickSyncDecoding</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
+ <item>
+ <key>
+ <string>EnableDxva</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
+ <item>
+ <key>
+ <string>ScalingMode</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">1</anyType>
+ </value>
+ </item>
</dictionary> \ No newline at end of file