diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Scan')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Scan/LibScan.cs | 3 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs | 50 |
2 files changed, 52 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs index beceb9361..7558bc163 100644 --- a/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs +++ b/win/CS/HandBrakeWPF/Services/Scan/LibScan.cs @@ -388,7 +388,8 @@ namespace HandBrakeWPF.Services.Scan MainTitle = titles.MainFeature == title.Index, Playlist = title.Type == 1 ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null, FramerateNumerator = title.FrameRate.Num, - FramerateDenominator = title.FrameRate.Den + FramerateDenominator = title.FrameRate.Den, + Type = title.Type }; int currentTrack = 1; diff --git a/win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs b/win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs index 32fddb36d..e60520fa7 100644 --- a/win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs +++ b/win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs @@ -11,10 +11,14 @@ namespace HandBrakeWPF.Services.Scan.Model { using System; using System.Collections.Generic; + using System.IO; using System.Linq; using HandBrake.ApplicationServices.Interop.Model; + using HandBrakeWPF.Model; + using HandBrakeWPF.Utilities; + /// <summary> /// An object that represents a single Title of a DVD /// </summary> @@ -123,6 +127,52 @@ namespace HandBrakeWPF.Services.Scan.Model /// </summary> public string SourceName { get; set; } + public string SourceDisplayName + { + get + { + switch (this.Type) + { + case 0: // HB_DVD_TYPE + case 1: // HB_BD_TYPE + default: + return string.Empty; + case 2: // HB_STREAM_TYPE + case 3: // HB_FF_STREAM_TYPE + return Path.GetFileNameWithoutExtension(this.SourceName); + } + } + } + + public string ItemDisplayText + { + get + { + return string.Format( + "{0}{1} ({2:00}:{3:00}:{4:00}) {5}", + this.TitleNumber, + this.Playlist, + this.Duration.Hours, + this.Duration.Minutes, + this.Duration.Seconds, + this.SourceDisplayName); + } + } + + public string ItemDisplayTextClosed + { + get + { + return string.Format( + "{0}{1} ({2:00}:{3:00}:{4:00})", + this.TitleNumber, + this.Playlist, + this.Duration.Hours, + this.Duration.Minutes, + this.Duration.Seconds); + } + } + #endregion /// <summary> |