From: sr55 Date: Mon, 25 Dec 2017 17:01:17 +0000 (+0000) Subject: WinGui: Display Source Names in the Title Dropdown (only when open), when we are... X-Git-Tag: 1.1.0~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de47c6c4b9198c951a3160802158aa1c0beff604;p=handbrake WinGui: Display Source Names in the Title Dropdown (only when open), when we are not scanning a DVD / Bluray. --- 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; + /// /// An object that represents a single Title of a DVD /// @@ -123,6 +127,52 @@ namespace HandBrakeWPF.Services.Scan.Model /// 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 /// diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index f4fffe924..d8e7a27fa 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -304,11 +304,25 @@