feat(slint): minimal playback wiring + Queue, plus detail/Settings fixes

Playback (minimal, album-focused):
- playback.rs controller: play an album (set queue + start audio),
  play a single track, enqueue, play a queue index, transport
  (play/pause, next, previous, seek, volume)
- the audible step uses Player::play_track (fetch -> download -> play);
  the protected audio backend is untouched
- a 450ms poll loop pushes position/progress/times/playing onto
  NowPlayingState and auto-advances at end of track
- NowPlayingState / QueueState globals; NowPlayingBar bound to real
  state (song card, seek bar, transport, volume); QueueSidebar lists
  the queue and rows play on click
- a played track is recorded into the recently-played store

Detail views:
- album description and artist biography stay with the metadata,
  filling the width to the right of the artwork (not below the header)
- header nav tabs gained a dropdown caret and 2px side padding

Settings > Playback defaults are now opt-out: show context icon,
restore session, resume position and stream-uncached default on;
streaming-only stays opt-in; initial buffer defaults to 2s.

Known gaps: queue/now-playing artwork not yet threaded (Image is not
Send); autoplay-mode preference not consulted by auto-advance; buffer
progress line stays at 0.

cc
This commit is contained in:
vicrodh committed 2026-05-18 22:16:13 -06:00
1 parent 33df7bce76
commit 7e6e548598
12 files changed
+1012 -72

No files matched your search

+95 -3
View File
@@ -10,7 +10,7 @@ import { Spacing } from "../foundation/spacing.slint";
import { Typography } from "../foundation/typography.slint";
import { Radius } from "../foundation/radius.slint";
import { QbzIcon } from "../primitives/QbzIcon.slint";
import { ShellState } from "../state.slint";
import { ShellState, QueueState } from "../state.slint";
component CloseButton inherits Rectangle {
callback clicked();
@@ -36,6 +36,79 @@ component CloseButton inherits Rectangle {
}
}
// One queue entry row — thumbnail, title, artist, playing indicator.
component QueueRow inherits Rectangle {
in property <string> title;
in property <string> artist;
in property <image> artwork;
in property <bool> playing: false;
callback clicked();
height: 56px;
background: ta.has-hover ? Theme.surface-hover : transparent;
HorizontalLayout {
padding-left: Spacing.md;
padding-right: Spacing.md;
padding-top: 6px;
padding-bottom: 6px;
spacing: 10px;
// Small album thumbnail.
Rectangle {
width: 44px;
height: 44px;
border-radius: 4px;
background: Theme.surface-elevated;
clip: true;
if root.artwork.width > 0: Image {
source: root.artwork;
width: 100%;
height: 100%;
image-fit: cover;
}
}
// Title + artist.
VerticalLayout {
horizontal-stretch: 1;
alignment: center;
spacing: 2px;
Text {
text: root.title;
color: root.playing ? Theme.accent : Theme.text-primary;
font-size: Typography.body;
font-weight: root.playing ? Typography.semibold : Typography.regular;
overflow: elide;
}
Text {
text: root.artist;
color: Theme.text-muted;
font-size: 11px;
overflow: elide;
}
}
// Now-playing indicator.
VerticalLayout {
alignment: center;
if root.playing: QbzIcon {
source: @image-url("../assets/icons/audio-lines.svg");
width: 15px;
height: 15px;
tint: Theme.accent;
}
}
}
ta := TouchArea {
mouse-cursor: pointer;
clicked => {
root.clicked();
}
}
}
export component QueueSidebar inherits Rectangle {
width: 320px;
background: Theme.surface-card;
@@ -72,14 +145,33 @@ export component QueueSidebar inherits Rectangle {
background: Theme.border-subtle;
}
// Body — placeholder until queue contents are wired.
// Body — the live queue, or an empty-state placeholder.
Rectangle {
vertical-stretch: 1;
Text {
if QueueState.items.length == 0: Text {
text: @tr("Nothing queued");
color: Theme.text-muted;
font-size: Typography.body;
}
if QueueState.items.length > 0: Flickable {
viewport-width: self.width;
viewport-height: rows.preferred-height;
rows := VerticalLayout {
spacing: 0px;
for item[idx] in QueueState.items: QueueRow {
title: item.title;
artist: item.artist;
artwork: item.artwork;
playing: item.playing;
clicked => {
QueueState.play-index(idx);
}
}
}
}
}
}
}