WIP cava process

This commit is contained in:
Sem
2026-04-10 23:58:23 +02:00
parent 9f5eb82fe1
commit 7bcd3220dd
3 changed files with 45 additions and 4 deletions

View File

@@ -3,13 +3,20 @@ import QtQuick
import QtQuick.Layouts
import "../constants"
import "../services"
Row {
id: root
property string artist: ""
property string title: ""
property string artUrl: ""
property int maxTextLength: 50
// if the artist - title text is too long, truncate it
readonly property string displayText: {
const fullText = artist !== "" ? (artist + " - " + title) : title
return fullText.length > maxTextLength ? fullText.substring(0, maxTextLength - 3) + "..." : fullText
}
visible: title !== ""
spacing: 6
@@ -26,6 +33,14 @@ Row {
// anchors.fill: parent
}
CavaService {
id: cavaService
onCavaDataChanged: {
// TODO update the canvas with the new data
// console.log("Cava data changed: " + data)
}
}
Image {
width: 18
height: 18
@@ -35,11 +50,10 @@ Row {
}
Text {
text: root.artist !== "" ? (root.artist + " - " + root.title) : root.title
text: root.displayText
color: Colors.md3.primary
font.family: Constants.fontFamily
font.pixelSize: Constants.fontSize
elide: Text.ElideRight
anchors.verticalCenter: parent.verticalCenter
z: 1
}