]> granicus.if.org Git - handbrake/commitdiff
WinGui: Couple of fixes for the Edit Queue feature. (Video Tune, Video Bitrate,...
authorScott <sr55.hb@outlook.com>
Sun, 27 Dec 2015 20:15:22 +0000 (20:15 +0000)
committerScott <sr55.hb@outlook.com>
Sun, 27 Dec 2015 20:15:22 +0000 (20:15 +0000)
In addition, if the app recovers the queue, it will by default enable the whole UI now. This is needed particularly with the in-line queue when enabled.

win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/Views/VideoView.xaml

index b9e8da0e479187a24508399e557f7b0dd43fbd93..4e7ef3987b459d8784ee2318481c6fd0d3a79380 100644 (file)
@@ -1160,6 +1160,10 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 this.ShowSourceSelection = true;\r
             }\r
+            else\r
+            {\r
+                this.HasSource = true; // Enable the GUI. Needed for in-line queue.\r
+            }\r
 \r
             this.SelectedPreset = this.presetService.DefaultPreset;\r
 \r
index c8910b770a1dbda9f61936753a152c4b3e00ca64..53c7c7882efa56806dc7e59e5ca5538854da8362 100644 (file)
@@ -69,7 +69,6 @@ namespace HandBrakeWPF.ViewModels
         private bool fastDecode;\r
         private bool displayTuneControls;\r
         private bool displayLevelControl;\r
-\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -366,6 +365,26 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// The Video Bitrate.\r
+        /// </summary>\r
+        public int? VideoBitrate\r
+        {\r
+            get\r
+            {\r
+                return this.Task.VideoBitrate;\r
+            }\r
+            set\r
+            {\r
+                if (value == this.Task.VideoBitrate)\r
+                {\r
+                    return;\r
+                }\r
+                this.Task.VideoBitrate = value;\r
+                this.NotifyOfPropertyChange(() => this.VideoBitrate);\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Gets DisplayRF.\r
         /// </summary>\r
@@ -616,7 +635,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return this.fastDecode;\r
+                return this.Task.VideoTunes.Contains(VideoTune.FastDecode);\r
             }\r
             set\r
             {\r
@@ -625,9 +644,6 @@ namespace HandBrakeWPF.ViewModels
                     return;\r
                 }\r
                 this.fastDecode = value;\r
-                this.NotifyOfPropertyChange(() => this.FastDecode);\r
-                this.NotifyOfPropertyChange(() => FullOptionsTooltip);\r
-                ResetAdvancedTab();\r
 \r
                 // Update the encode task\r
                 if (value && !this.Task.VideoTunes.Contains(VideoTune.FastDecode))\r
@@ -637,7 +653,11 @@ namespace HandBrakeWPF.ViewModels
                 else\r
                 {\r
                     this.Task.VideoTunes.Remove(VideoTune.FastDecode);\r
-                }          \r
+                }\r
+\r
+                this.NotifyOfPropertyChange(() => this.FastDecode);\r
+                this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
+                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -654,8 +674,8 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 this.Task.VideoPreset = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoPreset);\r
-                this.NotifyOfPropertyChange(() => FullOptionsTooltip);\r
-                ResetAdvancedTab();\r
+                this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
+                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -711,7 +731,9 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return this.videoTune;\r
+                VideoTune tune = this.Task.VideoTunes.FirstOrDefault(t => !Equals(t, VideoTune.FastDecode))\r
+                                 ?? VideoTune.None;\r
+                return tune;\r
             }\r
             set\r
             {\r
@@ -720,21 +742,23 @@ namespace HandBrakeWPF.ViewModels
                     return;\r
                 }\r
                 this.videoTune = value;\r
-                this.NotifyOfPropertyChange(() => this.VideoTune);\r
-                this.NotifyOfPropertyChange(() => FullOptionsTooltip);\r
-                ResetAdvancedTab();\r
 \r
                 // Update the encode task.\r
+                bool hasFastDecode = this.Task.VideoTunes.Contains(VideoTune.FastDecode);\r
                 this.Task.VideoTunes.Clear();\r
                 if (value != null && !Equals(value, VideoTune.None))\r
                 {\r
                     this.Task.VideoTunes.Add(value);\r
                 }\r
 \r
-                if (this.FastDecode)\r
+                if (hasFastDecode)\r
                 {\r
                     this.Task.VideoTunes.Add(VideoTune.FastDecode);\r
                 }\r
+\r
+                this.NotifyOfPropertyChange(() => this.VideoTune);\r
+                this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
+                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -751,8 +775,8 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 this.Task.VideoProfile = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoProfile);\r
-                this.NotifyOfPropertyChange(() => FullOptionsTooltip);\r
-                ResetAdvancedTab();\r
+                this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
+                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -769,8 +793,8 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 this.Task.VideoLevel = value;\r
                 this.NotifyOfPropertyChange(() => this.VideoLevel);\r
-                this.NotifyOfPropertyChange(() => FullOptionsTooltip);\r
-                ResetAdvancedTab();\r
+                this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);\r
+                this.ResetAdvancedTab();\r
             }\r
         }\r
 \r
@@ -928,6 +952,8 @@ namespace HandBrakeWPF.ViewModels
             this.Task = task;\r
             this.SetRF(task.Quality);\r
 \r
+            this.ShowPeakFramerate = this.IsPeakFramerate;\r
+\r
             this.NotifyOfPropertyChange(() => this.IsConstantFramerate);\r
             this.NotifyOfPropertyChange(() => this.IsConstantQuantity);\r
             this.NotifyOfPropertyChange(() => this.IsPeakFramerate);\r
@@ -939,17 +965,23 @@ namespace HandBrakeWPF.ViewModels
             this.NotifyOfPropertyChange(() => this.RF);\r
             this.NotifyOfPropertyChange(() => this.DisplayRF);\r
             this.NotifyOfPropertyChange(() => this.IsLossless);\r
-            this.NotifyOfPropertyChange(() => this.Task.VideoBitrate);\r
+            this.NotifyOfPropertyChange(() => this.VideoBitrate);\r
             this.NotifyOfPropertyChange(() => this.Task.Quality);\r
             this.NotifyOfPropertyChange(() => this.Task.TwoPass);\r
             this.NotifyOfPropertyChange(() => this.Task.TurboFirstPass);\r
-\r
             this.NotifyOfPropertyChange(() => this.VideoTune);\r
             this.NotifyOfPropertyChange(() => this.VideoProfile);\r
-            this.NotifyOfPropertyChange(() => this.VideoProfile);\r
+            this.NotifyOfPropertyChange(() => this.VideoPreset);\r
             this.NotifyOfPropertyChange(() => this.VideoLevel);\r
             this.NotifyOfPropertyChange(() => this.FastDecode);\r
             this.NotifyOfPropertyChange(() => this.ExtraArguments);\r
+\r
+            HBVideoEncoder encoder = HandBrakeEncoderHelpers.VideoEncoders.FirstOrDefault(s => s.ShortName == EnumHelper<VideoEncoder>.GetShortName(this.SelectedVideoEncoder));\r
+            if (encoder != null && this.VideoPreset != null)\r
+            {\r
+                int index = encoder.Presets.IndexOf(this.VideoPreset.ShortName);\r
+                this.VideoPresetValue = index;\r
+            }          \r
         }\r
 \r
         /// <summary>\r
index 2f20044815fecf693041e4487daebc62b86bbd14..aaa8064e83aebc859fb479c5c8a4a8056e7a3e0f 100644 (file)
                 <StackPanel Orientation="Horizontal" Margin="0,0,0,6">\r
                     <RadioButton Content="{x:Static Properties:ResourcesUI.VideoView_AverageBitrate}" ToolTip="{x:Static Properties:ResourcesTooltips.Video_AvgBitrate}" \r
                                  IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>\r
-                    <TextBox Width="75" Text="{Binding Task.VideoBitrate, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
+                    <TextBox Width="75" Text="{Binding VideoBitrate, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"\r
                              ToolTip="{x:Static Properties:ResourcesTooltips.Video_AvgBitrate}" />\r
                 </StackPanel>\r
 \r