This commit is contained in:
2025-11-15 00:24:42 +01:00
parent c9076b74ab
commit 0c673bc923
9 changed files with 410 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ Item {
property int count: 6
property int barWidth: 5
property int barSpacing: 3
property bool forceEnable: false
implicitWidth: root.barWidth * root.count + root.barSpacing * (root.count - 1)
implicitHeight: parent.height - 10
@@ -19,6 +20,7 @@ Item {
id: cavaProcess
count: root.count
forceEnable: root.forceEnable
}
RowLayout {
@@ -55,12 +57,14 @@ Item {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton)
MusicManager.playPause();
else if (mouse.button === Qt.RightButton)
SettingsService.showLyricsBar = !SettingsService.showLyricsBar;
else if (mouse.button === Qt.MiddleButton)
root.forceEnable = !root.forceEnable;
}
onWheel: function(wheel) {
if (wheel.angleDelta.y > 0)

View File

@@ -31,12 +31,13 @@ Scope {
}
})
property var values: Array(count).fill(0)
property bool forceEnable: false
Process {
id: process
stdinEnabled: true
running: !MusicManager.isAllPaused()
running: root.forceEnable || !MusicManager.isAllPaused()
command: ["cava", "-p", "/dev/stdin"]
onExited: {
stdinEnabled = true;