summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Scan
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-12-25 17:01:17 +0000
committersr55 <[email protected]>2017-12-25 17:01:17 +0000
commitde47c6c4b9198c951a3160802158aa1c0beff604 (patch)
tree095ce5ccf1c4a178709fb9a4bf27da46386b9be9 /win/CS/HandBrakeWPF/Services/Scan
parent0ee7c489ca5c0408877d304b65cb1d92160af807 (diff)
WinGui: Display Source Names in the Title Dropdown (only when open), when we are not scanning a DVD / Bluray.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Scan')
-rw-r--r--win/CS/HandBrakeWPF/Services/Scan/LibScan.cs3
-rw-r--r--win/CS/HandBrakeWPF/Services/Scan/Model/Title.cs50
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>