summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-10-20 19:54:51 +0000
committersr55 <[email protected]>2013-10-20 19:54:51 +0000
commit48047d258d3c9f577440d0d8053b8eb0d7021ec7 (patch)
tree22fba1e9aacf00d1f4b90168130919ed8bea21ce /win/CS/HandBrakeWPF
parent02786e4cc8a6ac8edfad11ab216d4e65b1ebeff4 (diff)
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
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs33
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs6
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml3
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml8
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
/// </summary>
public const string EnableQuickSync = "EnableQuickSync";
+ /// <summary>
+ /// The add foreign audio scan track.
+ /// </summary>
+ 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
/// </summary>
private bool enableQuickSync;
+ /// <summary>
+ /// The add foreign audio scan track.
+ /// </summary>
+ private bool addForeignAudioScanTrack;
+
#endregion
#region Constructors and Destructors
@@ -1033,6 +1038,26 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets a value indicating whether add foreign audio scan track.
+ /// </summary>
+ 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<bool>(UserSettingConstants.UseClosedCaption);
this.ShowAdvancedPassthruOpts = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedAudioPassthruOpts);
-
+ this.AddForeignAudioScanTrack = this.userSettingService.GetUserSetting<bool>(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<bool>(UserSettingConstants.AddForeignAudioScanTrack))
+ {
+ this.Add(ForeignAudioSearchTrack);
+ }
+
// New DUB Settings
int mode = this.UserSettingService.GetUserSetting<int>(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 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@@ -253,6 +254,8 @@
ItemsSource="{Binding AddSubtitleModeOptions}" SelectedIndex="{Binding SelectedAddSubtitleMode}" Width="120" Margin="0,0,5,0" />
<CheckBox Content="Add Closed Captions when available" Grid.Column="3" Grid.Row="1" Margin="0,5,0,0"
HorizontalAlignment="Left" IsChecked="{Binding AddClosedCaptions}"/>
+ <CheckBox Content="Add 'Foreign Audio Scan'" Grid.Column="3" Grid.Row="2" Margin="0,5,0,0"
+ HorizontalAlignment="Left" IsChecked="{Binding AddForeignAudioScanTrack}"/>
</Grid>
<TextBlock Text="Additional languages for possible selection" Grid.Column="0" Margin="10,20,0,0" FontSize="14"/>
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 @@
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">0</anyType>
</value>
</item>
+ <item>
+ <key>
+ <string>AddForeignAudioScanTrack</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
</dictionary> \ No newline at end of file