feat(player): add IQueueService orchestrating album playback above the single-slot player (P11 11.F)
Queue owns ordered tracks, current index, skip-fwd/back, and auto-advance via the player's TrackEnded hook; binds through Attach (no ctor growth, no service-locator). Player-bar skip controls; empty-queue play unchanged. Adds QueueService unit tests.
This commit is contained in:
@@ -43,6 +43,9 @@ public abstract class AudioPlayerService : IPlayerService, IAsyncDisposable
|
||||
/// <inheritdoc />
|
||||
public event Action? StateChanged;
|
||||
|
||||
/// <inheritdoc />
|
||||
public event Action? TrackEnded;
|
||||
|
||||
protected AudioPlayerService(AudioInteropService audioInterop, TrackMediaClient trackMediaClient)
|
||||
{
|
||||
_audioInterop = audioInterop;
|
||||
@@ -268,6 +271,12 @@ public abstract class AudioPlayerService : IPlayerService, IAsyncDisposable
|
||||
CurrentTime = 0;
|
||||
Duration = null;
|
||||
await NotifyStateChanged();
|
||||
|
||||
// Fire AFTER the state notification so any queue orchestrator that advances on this
|
||||
// signal selects the next track against a fully-settled idle state. Raised only on
|
||||
// organic end-of-stream — stop/unload/track-switch go through ResetToIdle, which does
|
||||
// not raise this — so a subscriber can treat it unambiguously as "advance the queue."
|
||||
TrackEnded?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user