summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <sr55.hb@outlook.com>2014-08-26 22:36:39 +0000
committersr55 <sr55.hb@outlook.com>2014-08-26 22:36:39 +0000
commit15417070c594a330923a62f0ab2054c39d3115f4 (patch)
treebef270e497e506641e4c79a060914a0f40e8f767 /win/CS
parent46824299f7139f1ad13426fbb03ad75da02b4f33 (diff)
WinGui: Only show Turbo First pass checkbox on x264
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6368 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs34
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml2
3 files changed, 36 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index af9ae9b00..0cecd6229 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -497,7 +497,7 @@ namespace HandBrake.ApplicationServices.Utilities
if (task.TwoPass)
query += " -2 ";
- if (task.TurboFirstPass)
+ if (task.TurboFirstPass && task.VideoEncoder == VideoEncoder.X264)
query += " -T ";
if (task.Framerate.HasValue)
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index c729e476e..d358988c5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -37,6 +37,12 @@ namespace HandBrakeWPF.ViewModels
/// </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.
+ */
+
#region Constants and Fields
/// <summary>
/// Same as source constant.
@@ -128,6 +134,11 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private int x265PresetValue;
+ /// <summary>
+ /// The display turbo first pass.
+ /// </summary>
+ private bool displayTurboFirstPass;
+
#endregion
#region Constructors and Destructors
@@ -565,6 +576,7 @@ namespace HandBrakeWPF.ViewModels
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);
@@ -1017,6 +1029,27 @@ namespace HandBrakeWPF.ViewModels
/// 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
+ {
+ get
+ {
+ return this.displayTurboFirstPass;
+ }
+ set
+ {
+ if (value.Equals(this.displayTurboFirstPass))
+ {
+ return;
+ }
+ this.displayTurboFirstPass = value;
+ this.NotifyOfPropertyChange(() => this.DisplayTurboFirstPass);
+ }
+ }
+
#endregion
#region Public Methods
@@ -1238,6 +1271,7 @@ namespace HandBrakeWPF.ViewModels
this.DisplayX264Options = encoder == VideoEncoder.X264;
this.DisplayQSVOptions = encoder == VideoEncoder.QuickSync;
this.DisplayX265Options = encoder == VideoEncoder.X265;
+ this.DisplayTurboFirstPass = encoder == VideoEncoder.X264;
if (encoder == VideoEncoder.QuickSync)
{
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index 039625b67..071c1535d 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -113,7 +113,7 @@
<CheckBox Content="2-Pass Encoding" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
IsChecked="{Binding TwoPass}" Margin="0,0,10,0" />
<CheckBox Content="Turbo first pass" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
- IsChecked="{Binding TurboFirstPass}" />
+ IsChecked="{Binding TurboFirstPass}" Visibility="{Binding DisplayTurboFirstPass, Converter={StaticResource boolToVisConverter}}" />
</StackPanel>
</StackPanel>