]> granicus.if.org Git - handbrake/commitdiff
WinGui: Disable 2-pass for NVEnc and VCE. this is not implemented.
authorsr55 <sr55.hb@outlook.com>
Wed, 21 Nov 2018 19:33:09 +0000 (19:33 +0000)
committersr55 <sr55.hb@outlook.com>
Wed, 21 Nov 2018 19:33:09 +0000 (19:33 +0000)
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/Views/VideoView.xaml

index 92bf9677f7252aec8528bdb5a645b0bc26c58e5e..b065755d726a98306287a900b30536e933522ef4 100644 (file)
@@ -217,10 +217,32 @@ namespace HandBrakeWPF.ViewModels
                 }\r
 \r
                 this.NotifyOfPropertyChange(() => this.IsConstantQuantity);\r
+                this.NotifyOfPropertyChange(() => this.IsTwoPassEnabled);\r
                 this.OnTabStatusChanged(null);\r
             }\r
         }\r
 \r
+        public bool IsTwoPassEnabled\r
+        {\r
+            get\r
+            {\r
+                if (this.IsConstantQuantity)\r
+                {\r
+                    return false;\r
+                }\r
+\r
+                if (this.SelectedVideoEncoder == VideoEncoder.NvencH264\r
+                    || this.SelectedVideoEncoder == VideoEncoder.NvencH265\r
+                    || this.SelectedVideoEncoder == VideoEncoder.VceH264\r
+                    || this.SelectedVideoEncoder == VideoEncoder.VceH265)\r
+                {\r
+                    return false;\r
+                }\r
+\r
+                return true;\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets or sets a value indicating whether IsPeakFramerate.\r
         /// </summary>\r
@@ -1511,6 +1533,7 @@ namespace HandBrakeWPF.ViewModels
             this.NotifyOfPropertyChange(() => this.Rfqp);\r
             this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled);\r
             this.NotifyOfPropertyChange(() => this.HighQualityLabel);\r
+            this.NotifyOfPropertyChange(() => this.IsTwoPassEnabled);\r
 \r
             // Handle some quicksync specific options.\r
             if (selectedEncoder == VideoEncoder.QuickSync || selectedEncoder == VideoEncoder.QuickSyncH265 || selectedEncoder == VideoEncoder.QuickSyncH26510b)\r
@@ -1518,10 +1541,18 @@ namespace HandBrakeWPF.ViewModels
                 this.TwoPass = false;\r
                 this.TurboFirstPass = false;\r
                 this.Task.Framerate = null;\r
-                this.NotifyOfPropertyChange(() => SelectedFramerate);\r
+                this.NotifyOfPropertyChange(() => this.SelectedFramerate);\r
                 this.UseAdvancedTab = false;\r
             }\r
 \r
+            if (selectedEncoder == VideoEncoder.NvencH264 || selectedEncoder == VideoEncoder.NvencH265 \r
+                                                          || selectedEncoder == VideoEncoder.VceH264 \r
+                                                          || selectedEncoder == VideoEncoder.VceH265)\r
+            {\r
+                this.TwoPass = false;\r
+                this.TurboFirstPass = false;\r
+            }\r
+\r
             // Cleanup Extra Arguments\r
             // Load the cached arguments. Saves the user from resetting when switching encoders.\r
             string result;\r
index cfe3b99904e9213641b17e6f81ca22635805766f..d277ea3eaf93516aa17f17fa37e32dbbc6c37233 100644 (file)
                 </StackPanel>\r
 \r
                 <StackPanel Orientation="Horizontal" Margin="30,0,0,0" Visibility="{Binding DisplayNonQSVControls, Converter={StaticResource boolToVisConverter}}">\r
-                    <CheckBox Content="{x:Static Properties:Resources.VideoView_2Pass}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
+                    <CheckBox Content="{x:Static Properties:Resources.VideoView_2Pass}" IsEnabled="{Binding IsTwoPassEnabled, Converter={StaticResource boolConverter}}"\r
                               IsChecked="{Binding TwoPass}" Margin="0,0,10,0" ToolTip="{x:Static Properties:ResourcesTooltips.Video_TwoPass}"  />\r
                     <CheckBox Content="{x:Static Properties:Resources.VideoView_TurboFirstPass}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
                               IsChecked="{Binding TurboFirstPass}" Visibility="{Binding DisplayTurboFirstPass, Converter={StaticResource boolToVisConverter}}"\r