Add playing status and times to view model

This commit is contained in:
Matt Nadareski
2021-07-02 09:35:56 -07:00
parent d2e489e63c
commit 9829f34227
2 changed files with 57 additions and 5 deletions

View File

@@ -4,6 +4,37 @@ namespace RedBookPlayer.GUI
{
public class PlayerViewModel : ReactiveObject
{
#region Player Status
private bool _playing;
public bool Playing
{
get => _playing;
set => this.RaiseAndSetIfChanged(ref _playing, value);
}
private ulong _currentSector;
public ulong CurrentSector
{
get => _currentSector;
set => this.RaiseAndSetIfChanged(ref _currentSector, value);
}
public int CurrentFrame => (int)(_currentSector / (75 * 60));
public int CurrentSecond => (int)(_currentSector / 75 % 60);
public int CurrentMinute => (int)(_currentSector % 75);
private ulong _totalSectors;
public ulong TotalSectors
{
get => _totalSectors;
set => this.RaiseAndSetIfChanged(ref _totalSectors, value);
}
public int TotalFrames => (int)(_totalSectors / (75 * 60));
public int TotalSeconds => (int)(_totalSectors / 75 % 60);
public int TotalMinutes => (int)(_totalSectors % 75);
private int _volume;
public int Volume
{
@@ -11,6 +42,10 @@ namespace RedBookPlayer.GUI
set => this.RaiseAndSetIfChanged(ref _volume, value);
}
#endregion
#region Disc Flags
private bool _applyDeEmphasis;
public bool ApplyDeEmphasis
{
@@ -52,5 +87,7 @@ namespace RedBookPlayer.GUI
get => _hiddenTrack;
set => this.RaiseAndSetIfChanged(ref _hiddenTrack, value);
}
#endregion
}
}