]> granicus.if.org Git - handbrake/commitdiff
WinGui: Only show Turbo First pass checkbox on x264
authorsr55 <sr55.hb@outlook.com>
Tue, 26 Aug 2014 22:36:39 +0000 (22:36 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 26 Aug 2014 22:36:39 +0000 (22:36 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6368 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/Views/VideoView.xaml

index af9ae9b0066959351f5aa4a2e652928d3cc9a426..0cecd62290ac96dfeb6e85292f927b61ce6da560 100644 (file)
@@ -497,7 +497,7 @@ namespace HandBrake.ApplicationServices.Utilities
             if (task.TwoPass)\r
                 query += " -2 ";\r
 \r
-            if (task.TurboFirstPass)\r
+            if (task.TurboFirstPass && task.VideoEncoder == VideoEncoder.X264)\r
                 query += " -T ";\r
 \r
             if (task.Framerate.HasValue)\r
index c729e476e2c57d298504336ed60cab4600906291..d358988c534716e966c4de7682e5424635abc010 100644 (file)
@@ -37,6 +37,12 @@ namespace HandBrakeWPF.ViewModels
     /// </summary>\r
     public class VideoViewModel : ViewModelBase, IVideoViewModel\r
     {\r
+        /*\r
+         * TODO\r
+         * 1. Refactor the Video Encoder Preset/Tune/Level options to be generic instead of encoder specific.\r
+         * 2. Model the UI Interactions in a better way.\r
+         */\r
+\r
         #region Constants and Fields\r
         /// <summary>\r
         /// Same as source constant.\r
@@ -128,6 +134,11 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private int x265PresetValue;\r
 \r
+        /// <summary>\r
+        /// The display turbo first pass.\r
+        /// </summary>\r
+        private bool displayTurboFirstPass;\r
+\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -565,6 +576,7 @@ namespace HandBrakeWPF.ViewModels
                 this.DisplayH264Options = value == VideoEncoder.X264 || value == VideoEncoder.QuickSync;\r
                 this.UseAdvancedTab = value != VideoEncoder.QuickSync && this.UseAdvancedTab;\r
                 this.DisplayNonQSVControls = value != VideoEncoder.QuickSync;\r
+                this.DisplayTurboFirstPass = value == VideoEncoder.X264; \r
 \r
                 this.NotifyOfPropertyChange(() => this.Rfqp);\r
                 this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);\r
@@ -1017,6 +1029,27 @@ namespace HandBrakeWPF.ViewModels
         /// Gets or sets X265Tunes.\r
         /// </summary>\r
         public IEnumerable<x265Tune> X265Tunes { get; set; }\r
+\r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether display turbo first pass.\r
+        /// </summary>\r
+        public bool DisplayTurboFirstPass\r
+        {\r
+            get\r
+            {\r
+                return this.displayTurboFirstPass;\r
+            }\r
+            set\r
+            {\r
+                if (value.Equals(this.displayTurboFirstPass))\r
+                {\r
+                    return;\r
+                }\r
+                this.displayTurboFirstPass = value;\r
+                this.NotifyOfPropertyChange(() => this.DisplayTurboFirstPass);\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Public Methods\r
@@ -1238,6 +1271,7 @@ namespace HandBrakeWPF.ViewModels
             this.DisplayX264Options = encoder == VideoEncoder.X264;\r
             this.DisplayQSVOptions = encoder == VideoEncoder.QuickSync;\r
             this.DisplayX265Options = encoder == VideoEncoder.X265;\r
+            this.DisplayTurboFirstPass = encoder == VideoEncoder.X264;\r
 \r
             if (encoder == VideoEncoder.QuickSync)\r
             {\r
index 039625b67fd0460012b5e63b52dcfd8fbcda5642..071c1535d5b20a5cd2089ba32ffcba93547883bb 100644 (file)
                     <CheckBox Content="2-Pass Encoding" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
                               IsChecked="{Binding TwoPass}" Margin="0,0,10,0" />\r
                     <CheckBox Content="Turbo first pass" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
-                              IsChecked="{Binding TurboFirstPass}" />\r
+                              IsChecked="{Binding TurboFirstPass}" Visibility="{Binding DisplayTurboFirstPass, Converter={StaticResource boolToVisConverter}}" />\r
                 </StackPanel>\r
 \r
             </StackPanel>\r