diff options
author | sr55 <[email protected]> | 2013-09-21 22:12:56 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-09-21 22:12:56 +0000 |
commit | a27b2c176c84d290339f3bb0dc5b9f9961817b30 (patch) | |
tree | a1b38d3c0bb432ec6fcb998d51dc32b397fe88ed /win/CS/HandBrakeWPF/ViewModels | |
parent | ab17c5c37fcc9a9f8a1617505b3131b9196f1549 (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/ViewModels')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 429 |
2 files changed, 282 insertions, 150 deletions
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);
|