]> granicus.if.org Git - handbrake/commitdiff
WinGui: Add a "Add 'Foreign Audio Scan'" option to the Automatic Subtitle track selec...
authorsr55 <sr55.hb@outlook.com>
Sun, 20 Oct 2013 19:54:51 +0000 (19:54 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 20 Oct 2013 19:54:51 +0000 (19:54 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5846 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/UserSettingConstants.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
win/CS/HandBrakeWPF/Views/OptionsView.xaml
win/CS/HandBrakeWPF/defaultsettings.xml

index 91c34e81861fee417b230b0d4e3e84b510816e2a..14b712ddf329e6d98c9bbd7ed6b39350a08803e7 100644 (file)
@@ -241,6 +241,11 @@ namespace HandBrakeWPF
         /// </summary>\r
         public const string EnableQuickSync = "EnableQuickSync";\r
 \r
+        /// <summary>\r
+        /// The add foreign audio scan track.\r
+        /// </summary>\r
+        public const string AddForeignAudioScanTrack = "AddForeignAudioScanTrack";\r
+\r
         #endregion\r
     }\r
 }
\ No newline at end of file
index bfe29b27b55e9c49d07bf1a5a75ceb3646c407d8..19d42918adf3a9978b72ff6925266f4820064531 100644 (file)
@@ -379,6 +379,11 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         private bool enableQuickSync;\r
 \r
+        /// <summary>\r
+        /// The add foreign audio scan track.\r
+        /// </summary>\r
+        private bool addForeignAudioScanTrack;\r
+\r
         #endregion\r
 \r
         #region Constructors and Destructors\r
@@ -1033,6 +1038,26 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Gets or sets a value indicating whether add foreign audio scan track.\r
+        /// </summary>\r
+        public bool AddForeignAudioScanTrack\r
+        {\r
+            get\r
+            {\r
+                return this.addForeignAudioScanTrack;\r
+            }\r
+            set\r
+            {\r
+                if (value.Equals(this.addForeignAudioScanTrack))\r
+                {\r
+                    return;\r
+                }\r
+                this.addForeignAudioScanTrack = value;\r
+                this.NotifyOfPropertyChange(() => this.AddForeignAudioScanTrack);\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region System and Logging\r
@@ -1420,7 +1445,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return this.enableQuickSync;\r
+                return this.enableQuickSync && this.IsQuickSyncAvailable;\r
             }\r
             set\r
             {\r
@@ -1880,7 +1905,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             this.AddClosedCaptions = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption);\r
             this.ShowAdvancedPassthruOpts = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);\r
-\r
+            this.AddForeignAudioScanTrack = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.AddForeignAudioScanTrack);\r
 \r
             // #############################\r
             // Video\r
@@ -2006,8 +2031,8 @@ namespace HandBrakeWPF.ViewModels
             this.userSettingService.SetUserSetting(UserSettingConstants.DubModeAudio, this.SelectedAddAudioMode);\r
             this.userSettingService.SetUserSetting(UserSettingConstants.DubModeSubtitle, this.SelectedAddSubtitleMode);\r
             this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedAudioPassthruOpts, this.ShowAdvancedPassthruOpts);\r
-\r
-\r
+            this.userSettingService.SetUserSetting(UserSettingConstants.AddForeignAudioScanTrack, this.AddForeignAudioScanTrack);\r
+            \r
             /* Video */\r
             this.userSettingService.SetUserSetting(UserSettingConstants.EnableQuickSync, this.EnableQuickSync);\r
             this.userSettingService.SetUserSetting(ASUserSettingConstants.DisableQuickSyncDecoding, this.DisableQuickSyncDecoding);\r
index feabc08f3e6cef36c25d0d4caff5b3f45cfb9ef8..1e8e964e565778f8e44dd9b7ac3613c352479548 100644 (file)
@@ -245,6 +245,12 @@ namespace HandBrakeWPF.ViewModels
         {\r
             this.Task.SubtitleTracks.Clear();\r
 \r
+            // Add Foreign Audio Scan\r
+            if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AddForeignAudioScanTrack))\r
+            {\r
+                this.Add(ForeignAudioSearchTrack);\r
+            }\r
+\r
             // New DUB Settings\r
             int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);\r
             switch (mode)\r
index c31fccae67091672b3b062658769741825329aac..955fbf1084550487ca47a43a54316062c123d6a3 100644 (file)
                         <Grid.RowDefinitions>\r
                             <RowDefinition Height="Auto" />\r
                             <RowDefinition Height="Auto" />\r
+                            <RowDefinition Height="Auto" />\r
                         </Grid.RowDefinitions>\r
 \r
                         <Grid.ColumnDefinitions>\r
                                   ItemsSource="{Binding AddSubtitleModeOptions}" SelectedIndex="{Binding SelectedAddSubtitleMode}" Width="120" Margin="0,0,5,0" />\r
                         <CheckBox Content="Add Closed Captions when available"  Grid.Column="3" Grid.Row="1" Margin="0,5,0,0" \r
                                   HorizontalAlignment="Left" IsChecked="{Binding AddClosedCaptions}"/>\r
+                        <CheckBox Content="Add 'Foreign Audio Scan'"  Grid.Column="3" Grid.Row="2" Margin="0,5,0,0" \r
+                                  HorizontalAlignment="Left" IsChecked="{Binding AddForeignAudioScanTrack}"/>\r
                     </Grid>\r
 \r
                     <TextBlock Text="Additional languages for possible selection" Grid.Column="0" Margin="10,20,0,0" FontSize="14"/>\r
index 3ce253d51e1d22a7f298f1ce9cd3dd2ffd5dc709..d2c3ef7b996240326c4e6519d6bd790b0b074ed2 100644 (file)
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">0</anyType>\r
     </value>\r
   </item>\r
+  <item>\r
+    <key>\r
+      <string>AddForeignAudioScanTrack</string>\r
+    </key>\r
+    <value>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+    </value>\r
+  </item>\r
 </dictionary>
\ No newline at end of file