Wire up disc changing to UI

This commit is contained in:
Matt Nadareski
2021-10-05 10:40:10 -07:00
parent 7b01715a11
commit 211ee8cecf
10 changed files with 181 additions and 91 deletions

View File

@@ -41,6 +41,15 @@ namespace RedBookPlayer.Models.Hardware
#region OpticalDisc Passthrough
/// <summary>
/// Path to the disc image
/// </summary>
public string ImagePath
{
get => _imagePath;
private set => this.RaiseAndSetIfChanged(ref _imagePath, value);
}
/// <summary>
/// Current track number
/// </summary>
@@ -156,6 +165,7 @@ namespace RedBookPlayer.Models.Hardware
/// </summary>
public ulong TotalTime => _opticalDiscs[CurrentDisc]?.TotalTime ?? 0;
private string _imagePath;
private int _currentTrackNumber;
private ushort _currentTrackIndex;
private ushort _currentTrackSession;
@@ -669,6 +679,7 @@ namespace RedBookPlayer.Models.Hardware
/// </summary>
private void OpticalDiscStateChanged(object sender, PropertyChangedEventArgs e)
{
ImagePath = _opticalDiscs[CurrentDisc].ImagePath;
CurrentTrackNumber = _opticalDiscs[CurrentDisc].CurrentTrackNumber;
CurrentTrackIndex = _opticalDiscs[CurrentDisc].CurrentTrackIndex;
CurrentSector = _opticalDiscs[CurrentDisc].CurrentSector;