Music player: rail controls, now-playing equalizer, folder-linked playlists, auto-advance - #20
Merged
Merged
Conversation
A music icon opens a compact flyout: play/pause, next, stop, volume, and a playlist picker. While music plays the rail icon becomes an animated gold equalizer and its tooltip names the current track; a 2s state poll keeps the icon truthful when playback is driven from /music chat commands. Add playlist points at any local folder of MP3s via a directory junction under ~/.mandocode/music (nothing copied, CLI sees the same playlists); Remove deletes only the pointer and only offers itself on junction-backed playlists.
Picks up DevMando/MandoCode#67: tracks end honestly and auto-advance through the current playlist instead of going silent after one song.
The DispatcherQueueTimer was referenced only by a local, so the GC collected it mid-flight and the rail icon froze in its last state until a flyout open forced a refresh. Rooted in a field for the window's lifetime.
Adding a playlist now selects it immediately (switching live playback, or arming it for the play button), matched case-insensitively since discovery may re-case folder names. Picking a folder that's already a playlist selects the existing one instead of minting a numbered twin — matched by where the junction points, not by name.
Add-playlist's folder picker closes the flyout and unloads the combo, and the next RefreshMusicUi re-selected from the service's current genre — snapping the dropdown back to the previous playlist. Any selection (user or programmatic) now records itself as the service's genre, so every refresh re-derives the right selection.
Playlist plumbing (junctions, naming, rediscovery) moves out of the window class into Services/MusicPlaylists, reusing NoteStore's filename scrub and SnapshotNaming's uniquifier instead of third copies. Genre picks now route through ConfigCoordinator and persist. The poll compares a state key and refreshes the open flyout too, so auto-advance updates the track line and device errors surface immediately; it stops on window close. Rediscovery runs off the UI thread, junction checks no longer resolve targets (a junction to an unplugged drive can't block the UI), derivable state and duplicate XAML collapsed into a shared style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a music player to the Desktop — player controls on the left rail, an animated now-playing indicator, and user-defined playlists — and rolls the engine pin to pick up the fix that makes music play through a playlist instead of going silent after one song. The code was reviewed by four independent cleanup passes (reuse, simplification, efficiency, architecture) and refactored accordingly before this description was written.
What's new (plain language)
1. A music player on the left rail. Clicking the music icon opens a small panel: play/pause, next, stop, a volume slider, and a playlist picker. No page navigation — it works like a system-tray player.
2. You can see that music is playing, and what. While a song plays, the rail icon becomes a small animated gold equalizer (the Desktop's answer to the CLI's title-bar visualizer). Hovering it names the current song. The indicator stays truthful no matter how playback changes — panel buttons, /music chat commands, songs advancing on their own, or an audio-device failure — and any playback error is shown in the panel the moment it happens.
3. Bring-your-own playlists. "Add playlist" points the player at any folder of MP3s on your disk. Nothing is copied or moved — the app creates a lightweight folder link under ~/.mandocode/music, which means the CLI sees the same playlists too. The new playlist is selected immediately; re-adding a folder that's already a playlist just selects the existing one (no duplicates). "Remove" deletes only the link, never your files, and only ever appears for playlists added this way. Your selected playlist and volume both survive an app restart.
4. Music now plays through the playlist (engine fix). Previously a song played once and then went silent forever while the player still claimed to be playing — in both the CLI and Desktop. The engine now detects the end of a song and advances to a random next track (a one-song playlist repeats). Fixed upstream in MandoCode PR #67; this PR rolls the pin to pick it up.
Scope / risk
Verification