diff options
author | sr55 <[email protected]> | 2013-10-20 20:17:44 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-10-20 20:17:44 +0000 |
commit | 2a07df4f3cdf9fe81c6b5fe6c3f4a2278067ebf6 (patch) | |
tree | 5c0675b7dd6439df464d55b062d404c144427b25 /win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | |
parent | 48047d258d3c9f577440d0d8053b8eb0d7021ec7 (diff) |
WinGui: Fix adding a new VobSub or PGS subtitle, default it to "Burned In" for MP4 files only. Also defaulted Foreign Audio Scan to Burned In for MP4's now.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5847 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 1e8e964e5..4a28438b7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -13,6 +13,7 @@ namespace HandBrakeWPF.ViewModels using System.Collections.Specialized;
using System.IO;
using System.Linq;
+ using System.Windows.Controls.Primitives;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
@@ -225,7 +226,7 @@ namespace HandBrakeWPF.ViewModels /// <param name="subtitle">
/// The subtitle.
/// </param>
- public void SelectBurnedInTrack(SubtitleTrack subtitle)
+ public void SetBurnedToFalseForAllExcept(SubtitleTrack subtitle)
{
foreach (SubtitleTrack track in this.Task.SubtitleTracks)
{
@@ -372,11 +373,12 @@ namespace HandBrakeWPF.ViewModels string preferred =
this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguageForSubtitles);
- Subtitle source = subtitle ??
- ((this.SourceTracks != null)
- ? (this.SourceTracks.FirstOrDefault(l => l.Language == preferred) ??
- this.SourceTracks.FirstOrDefault(s => s.SubtitleType != SubtitleType.ForeignAudioSearch))
- : null);
+ Subtitle source = subtitle
+ ?? ((this.SourceTracks != null)
+ ? (this.SourceTracks.FirstOrDefault(l => l.Language == preferred)
+ ?? this.SourceTracks.FirstOrDefault(
+ s => s.SubtitleType != SubtitleType.ForeignAudioSearch))
+ : null);
if (source == null)
{
@@ -384,18 +386,22 @@ namespace HandBrakeWPF.ViewModels }
SubtitleTrack track = new SubtitleTrack
- {
- SubtitleType = SubtitleType.VobSub,
- SourceTrack = source,
- };
-
- if ((source.SubtitleType == SubtitleType.PGS || source.SubtitleType == SubtitleType.VobSub) &&
- this.Task != null &&
- (this.Task.OutputFormat == OutputFormat.Mp4 || this.Task.OutputFormat == OutputFormat.M4V))
+ {
+ SubtitleType = SubtitleType.VobSub,
+ SourceTrack = source,
+ };
+
+ if ((source.SubtitleType == SubtitleType.PGS || source.SubtitleType == SubtitleType.VobSub || source.SubtitleType == SubtitleType.ForeignAudioSearch)
+ && this.Task != null
+ && (this.Task.OutputFormat == OutputFormat.Mp4 || this.Task.OutputFormat == OutputFormat.M4V))
{
- this.SelectBurnedInTrack(track);
+ if (track.CanBeBurned)
+ {
+ track.Burned = true;
+ this.SetBurnedToFalseForAllExcept(track);
+ }
}
-
+
this.Task.SubtitleTracks.Add(track);
}
|