Added tracking/capturing/restoration of audio playback state and position.

This commit is contained in:
2026-08-08 16:37:55 -04:00
parent c262ee4caa
commit 0942e3e5ad
11 changed files with 92 additions and 15 deletions

View File

@@ -225,6 +225,20 @@ public partial class PlayerViewModel : ViewModelBase
_timer.Tick += TickTock;
_dispatcherQueue = DispatcherQueue.GetForCurrentThread();
TryRestore();
}
private void TryRestore()
{
if (_audioPlayer.PlayingSong is null)
return;
Song = _audioPlayer.PlayingSong.Song;
Position = _audioPlayer.Position;
CurrentPosition = _audioPlayer.Position;
Task.Run(UpdateImage);
}
#region Event Handlers