summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-05 17:42:02 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-05 17:42:02 +1000
commit6afd2a1525c1141e124190a4a51a5944f02353c3 (patch)
treea82a19489bb4c9ed79d4001d4ac4d5a76174546e /modules
parentdashboard: center media pane (diff)
downloadcaelestia-shell-6afd2a1525c1141e124190a4a51a5944f02353c3.tar.gz
caelestia-shell-6afd2a1525c1141e124190a4a51a5944f02353c3.tar.bz2
caelestia-shell-6afd2a1525c1141e124190a4a51a5944f02353c3.zip
internal: move cava to service
Diffstat (limited to 'modules')
-rw-r--r--modules/dashboard/Media.qml19
1 files changed, 7 insertions, 12 deletions
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index 15f0232..27b7c44 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -21,8 +21,6 @@ Item {
return active?.length ? active.position / active.length : 0;
}
- property list<int> cava: []
-
function lengthStr(length: int): string {
if (length < 0)
return "-1:-1";
@@ -48,15 +46,12 @@ Item {
onTriggered: Players.active?.positionChanged()
}
- Process {
- running: true
- command: ["sh", "-c", `printf '[general]\nframerate=60\nbars=${DashboardConfig.visualiserBars}\n[output]\nchannels=mono\nmethod=raw\nraw_target=/dev/stdout\ndata_format=ascii\nascii_max_range=100' | cava -p /dev/stdin`]
- stdout: SplitParser {
- onRead: data => {
- root.cava = data.slice(0, -1).split(";").map(v => parseInt(v, 10));
- if (root.shouldUpdate)
- visualiser.requestPaint();
- }
+ Connections {
+ target: Cava
+
+ function onValuesChanged(): void {
+ if (root.shouldUpdate)
+ visualiser.requestPaint();
}
}
@@ -78,7 +73,7 @@ Item {
const ctx = getContext("2d");
ctx.reset();
- const values = root.cava;
+ const values = Cava.values;
const len = values.length;
ctx.strokeStyle = colour;