From 48047d258d3c9f577440d0d8053b8eb0d7021ec7 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 20 Oct 2013 19:54:51 +0000 Subject: [PATCH] WinGui: Add a "Add 'Foreign Audio Scan'" option to the Automatic Subtitle track selection feature. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5846 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/UserSettingConstants.cs | 5 +++ .../ViewModels/OptionsViewModel.cs | 33 ++++++++++++++++--- .../ViewModels/SubtitlesViewModel.cs | 6 ++++ win/CS/HandBrakeWPF/Views/OptionsView.xaml | 3 ++ win/CS/HandBrakeWPF/defaultsettings.xml | 8 +++++ 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index 91c34e818..14b712ddf 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -241,6 +241,11 @@ namespace HandBrakeWPF /// public const string EnableQuickSync = "EnableQuickSync"; + /// + /// The add foreign audio scan track. + /// + public const string AddForeignAudioScanTrack = "AddForeignAudioScanTrack"; + #endregion } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index bfe29b27b..19d42918a 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -379,6 +379,11 @@ namespace HandBrakeWPF.ViewModels /// private bool enableQuickSync; + /// + /// The add foreign audio scan track. + /// + private bool addForeignAudioScanTrack; + #endregion #region Constructors and Destructors @@ -1033,6 +1038,26 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets a value indicating whether add foreign audio scan track. + /// + public bool AddForeignAudioScanTrack + { + get + { + return this.addForeignAudioScanTrack; + } + set + { + if (value.Equals(this.addForeignAudioScanTrack)) + { + return; + } + this.addForeignAudioScanTrack = value; + this.NotifyOfPropertyChange(() => this.AddForeignAudioScanTrack); + } + } + #endregion #region System and Logging @@ -1420,7 +1445,7 @@ namespace HandBrakeWPF.ViewModels { get { - return this.enableQuickSync; + return this.enableQuickSync && this.IsQuickSyncAvailable; } set { @@ -1880,7 +1905,7 @@ namespace HandBrakeWPF.ViewModels this.AddClosedCaptions = this.userSettingService.GetUserSetting(UserSettingConstants.UseClosedCaption); this.ShowAdvancedPassthruOpts = this.userSettingService.GetUserSetting(UserSettingConstants.ShowAdvancedAudioPassthruOpts); - + this.AddForeignAudioScanTrack = this.userSettingService.GetUserSetting(UserSettingConstants.AddForeignAudioScanTrack); // ############################# // Video @@ -2006,8 +2031,8 @@ namespace HandBrakeWPF.ViewModels this.userSettingService.SetUserSetting(UserSettingConstants.DubModeAudio, this.SelectedAddAudioMode); this.userSettingService.SetUserSetting(UserSettingConstants.DubModeSubtitle, this.SelectedAddSubtitleMode); this.userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedAudioPassthruOpts, this.ShowAdvancedPassthruOpts); - - + this.userSettingService.SetUserSetting(UserSettingConstants.AddForeignAudioScanTrack, this.AddForeignAudioScanTrack); + /* Video */ this.userSettingService.SetUserSetting(UserSettingConstants.EnableQuickSync, this.EnableQuickSync); this.userSettingService.SetUserSetting(ASUserSettingConstants.DisableQuickSyncDecoding, this.DisableQuickSyncDecoding); diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index feabc08f3..1e8e964e5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -245,6 +245,12 @@ namespace HandBrakeWPF.ViewModels { this.Task.SubtitleTracks.Clear(); + // Add Foreign Audio Scan + if (this.UserSettingService.GetUserSetting(UserSettingConstants.AddForeignAudioScanTrack)) + { + this.Add(ForeignAudioSearchTrack); + } + // New DUB Settings int mode = this.UserSettingService.GetUserSetting(UserSettingConstants.DubModeSubtitle); switch (mode) diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index c31fccae6..955fbf108 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -230,6 +230,7 @@ + @@ -253,6 +254,8 @@ ItemsSource="{Binding AddSubtitleModeOptions}" SelectedIndex="{Binding SelectedAddSubtitleMode}" Width="120" Margin="0,0,5,0" /> + diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 3ce253d51..d2c3ef7b9 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -489,4 +489,12 @@ 0 + + + AddForeignAudioScanTrack + + + false + + \ No newline at end of file -- 2.40.0