From c214b3c5d6cf48ed719e9c13a4f5bda4dc7ad107 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 8 Jun 2025 20:25:54 +1000 Subject: feat: add ipc commands for stuff --- services/Players.qml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'services/Players.qml') diff --git a/services/Players.qml b/services/Players.qml index cbaf550..e9a3de4 100644 --- a/services/Players.qml +++ b/services/Players.qml @@ -55,5 +55,43 @@ Singleton { const active = root.active; return active ? active[prop] ?? "Invalid property" : "No active player"; } + + function list(): string { + return root.list.map(p => p.identity).join("\n"); + } + + function play(): void { + const active = root.active; + if (active?.canPlay) + active.play(); + } + + function pause(): void { + const active = root.active; + if (active?.canPause) + active.pause(); + } + + function playPause(): void { + const active = root.active; + if (active?.canTogglePlaying) + active.togglePlaying(); + } + + function previous(): void { + const active = root.active; + if (active?.canGoPrevious) + active.previous(); + } + + function next(): void { + const active = root.active; + if (active?.canGoNext) + active.next(); + } + + function stop(): void { + root.active?.stop(); + } } } -- cgit v1.2.3-freya