feat(player): add seekbar waveforms

Analyze audible tracks into a progressive 512-bin RMS document, cache complete results, and preserve gapless track boundaries. Render the waveform through a scenegraph item in both player bars behind a default-off preference.\n\ncx
This commit is contained in:
vicrodh committed 2026-08-25 01:16:58 -06:00
1 parent d11e946227
commit 0a3bdc3ec8
27 files changed
+1277 -108

No files matched your search

+20 -2
View File
@@ -44,6 +44,9 @@ Rectangle {
// PlayerBarSmall.slint).
color: ambientOn ? theme.surfaceCardA50 : theme.surfaceCard
readonly property bool ambientOn: theme.ambientOn
readonly property bool waveformVisible: QbzShell.seekbarWaveform
&& QbzPlayer.npSeekWaveformAnalyzed > 0
&& QbzPlayer.npSeekWaveform.length > 0
QbzTheme { id: theme }
@@ -216,12 +219,26 @@ Rectangle {
Rectangle {
id: seekTrack
width: parent.width
height: 3
height: root.waveformVisible ? 9 : 3
anchors.verticalCenter: parent.verticalCenter
radius: 2
color: theme.surfaceElevated
color: root.waveformVisible ? "transparent" : theme.surfaceElevated
SeekWaveformItem {
anchors.fill: parent
visible: root.waveformVisible
values: QbzPlayer.npSeekWaveform
playedProgress: QbzPlayer.npProgress
cacheProgress: QbzPlayer.npCacheProgress
baseColor: theme.surfaceElevated
cacheColor: Qt.rgba(theme.textMuted.r, theme.textMuted.g,
theme.textMuted.b, 0.35)
playedColor: theme.accent
}
// Buffered / cache line.
Rectangle {
visible: !root.waveformVisible
width: parent.width * Math.min(Math.max(QbzPlayer.npCacheProgress, 0), 1)
height: parent.height
radius: 2
@@ -235,6 +252,7 @@ Rectangle {
}
// Playback progress line.
Rectangle {
visible: !root.waveformVisible
width: parent.width * Math.min(Math.max(QbzPlayer.npProgress, 0), 1)
height: parent.height
radius: 2