TRAX: error display, retain track on failure, gray idle dot
1. Error text shows in red inside the desktop audio meter bar (scrollable) when TRAX load or playback fails — user gets feedback, not just a silent red dot. 2. LoadTrax no longer nulls _music on error — the track path is retained so the user sees what failed and can retry. 3. OnTraxPlaybackEnded now receives the NAudio exception and surfaces it. 4. TRAX dot is green (playing) or gray (idle/no track) — no more yellow or red states. 207 tests, 0 warnings.
This commit is contained in:
@@ -26,7 +26,7 @@ public sealed class MusicPlayer : IDisposable
|
||||
private float _localGain = 1f;
|
||||
|
||||
/// <summary>Raised when playback ends or is stopped (not on natural-end loop).</summary>
|
||||
public event Action? PlaybackEnded;
|
||||
public event Action<Exception?>? PlaybackEnded;
|
||||
|
||||
public string? TrackPath { get; private set; }
|
||||
|
||||
@@ -122,6 +122,6 @@ public sealed class MusicPlayer : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
PlaybackEnded?.Invoke();
|
||||
PlaybackEnded?.Invoke(e.Exception);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user