summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-11-24 11:24:43 +0000
committersr55 <[email protected]>2012-11-24 11:24:43 +0000
commit1c82ce41279bb0a2bb1efef73814b1e1099379cb (patch)
treedbaf58cbd292e0e722a81fc74340cfd92c439e72 /win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
parentc4250b87a11587ac17543af6890359be2f8fdebc (diff)
WinGui: Couple of Audio and Advanced Panel bug fixes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5080 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs37
1 files changed, 25 insertions, 12 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
index 5cfa1f413..e66ea0920 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
@@ -14,11 +14,8 @@ namespace HandBrakeWPF.ViewModels
using System.Globalization;
using System.Linq;
- using Caliburn.Micro;
-
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
- using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.Helpers;
@@ -33,6 +30,11 @@ namespace HandBrakeWPF.ViewModels
#region Constants and Fields
/// <summary>
+ /// AdvancedOptionsCache;
+ /// </summary>
+ private string optionsCache = string.Empty;
+
+ /// <summary>
/// Backing field for displaying x264 options
/// </summary>
private bool? displayX264Options;
@@ -164,13 +166,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.
/// </summary>
- /// <param name="windowManager">
- /// The window manager.
- /// </param>
- /// <param name="userSettingService">
- /// The user Setting Service.
- /// </param>
- public AdvancedViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ public AdvancedViewModel()
{
this.Task = new EncodeTask();
this.UpdateUIFromAdvancedOptions();
@@ -913,11 +909,28 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public void SetEncoder(VideoEncoder encoder)
{
- this.DisplayX264Options = encoder == VideoEncoder.X264;
- if (encoder == VideoEncoder.Theora)
+ // If we are switching from x264, cache it's settings.
+ if (this.DisplayX264Options.HasValue && this.DisplayX264Options.Value )
{
+ this.optionsCache = this.AdvancedOptionsString;
+ }
+
+ // UI Set for new encoder.
+ if (encoder == VideoEncoder.X264)
+ {
+ this.AdvancedOptionsString = optionsCache;
+ this.DisplayX264Options = true;
+ }
+ else if (encoder == VideoEncoder.Theora)
+ {
+ this.AdvancedOptionsString = string.Empty;
this.DisplayX264Options = null;
}
+ else
+ {
+ this.AdvancedOptionsString = string.Empty;
+ this.DisplayX264Options = false;
+ }
}
#endregion