feat: built-in volume management

- Volume slider on every node (green bar, draggable)
- Mute toggle button (M/m) on every node
- Backend: read volume/mute from PipeWire node props
- Backend: POST /api/volume {node_id, volume} to set volume
- Backend: POST /api/mute {node_id, mute} to toggle mute
- Graph JSON includes volume and mute fields per node
- Slider supports drag-to-adjust with mouse
This commit is contained in:
joren
2026-03-29 23:21:39 +02:00
parent 8c6a1f44c1
commit 65db5daa7c
7 changed files with 206 additions and 5 deletions

View File

@@ -358,4 +358,29 @@ export function deleteProfile(name: string) {
savePatchbayState();
}
// Volume control
export async function setNodeVolume(nodeId: number, volume: number) {
try {
await fetch('/api/volume', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ node_id: nodeId, volume }),
});
} catch (e) {
console.error('[api] volume failed:', e);
}
}
export async function setNodeMute(nodeId: number, mute: boolean) {
try {
await fetch('/api/mute', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ node_id: nodeId, mute }),
});
} catch (e) {
console.error('[api] mute failed:', e);
}
}
export { connectPorts, disconnectPorts };