mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Wire up disc changing to UI
This commit is contained in:
@@ -44,6 +44,15 @@ namespace RedBookPlayer.GUI.ViewModels
|
||||
|
||||
#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>
|
||||
@@ -159,6 +168,7 @@ namespace RedBookPlayer.GUI.ViewModels
|
||||
/// </summary>
|
||||
public ulong TotalTime => _player.TotalTime;
|
||||
|
||||
private string _imagePath;
|
||||
private int _currentTrackNumber;
|
||||
private ushort _currentTrackIndex;
|
||||
private ushort _currentTrackSession;
|
||||
@@ -274,6 +284,16 @@ namespace RedBookPlayer.GUI.ViewModels
|
||||
/// </summary>
|
||||
public ReactiveCommand<Unit, Unit> EjectCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Command for moving to the next disc
|
||||
/// </summary>
|
||||
public ReactiveCommand<Unit, Unit> NextDiscCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Command for moving to the previous disc
|
||||
/// </summary>
|
||||
public ReactiveCommand<Unit, Unit> PreviousDiscCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Command for moving to the next track
|
||||
/// </summary>
|
||||
@@ -359,6 +379,8 @@ namespace RedBookPlayer.GUI.ViewModels
|
||||
TogglePlayPauseCommand = ReactiveCommand.Create(ExecuteTogglePlayPause);
|
||||
StopCommand = ReactiveCommand.Create(ExecuteStop);
|
||||
EjectCommand = ReactiveCommand.Create(ExecuteEject);
|
||||
NextDiscCommand = ReactiveCommand.Create(ExecuteNextDisc);
|
||||
PreviousDiscCommand = ReactiveCommand.Create(ExecutePreviousDisc);
|
||||
NextTrackCommand = ReactiveCommand.Create(ExecuteNextTrack);
|
||||
PreviousTrackCommand = ReactiveCommand.Create(ExecutePreviousTrack);
|
||||
NextIndexCommand = ReactiveCommand.Create(ExecuteNextIndex);
|
||||
@@ -819,8 +841,17 @@ namespace RedBookPlayer.GUI.ViewModels
|
||||
});
|
||||
}
|
||||
|
||||
ImagePath = _player.ImagePath;
|
||||
Initialized = _player.Initialized;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(ImagePath) && Initialized)
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
App.MainWindow.Title = "RedBookPlayer - " + ImagePath.Split('/').Last().Split('\\').Last();
|
||||
});
|
||||
}
|
||||
|
||||
CurrentDisc = _player.CurrentDisc;
|
||||
CurrentTrackNumber = _player.CurrentTrackNumber;
|
||||
CurrentTrackIndex = _player.CurrentTrackIndex;
|
||||
|
||||
Reference in New Issue
Block a user