From cbc508349067ef479375683146151fef2de6f9b4 Mon Sep 17 00:00:00 2001 From: joren Date: Thu, 2 Apr 2026 19:48:02 +0200 Subject: [PATCH] feat: real-time dB level meters per node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backend: - One pw_stream (INPUT, F32) per audio node; for sinks use stream.capture.sink=true to read the monitor port - RT process callback computes instantaneous linear peak with no allocations; stored in std::atomic - Meter streams are filtered from the registry so they never appear in the graph or trigger recursive meter creation - Meter streams are created on first node-ready event, destroyed on node removal, and cleaned up on engine close - GET /api/peaks → {node_id: linear_peak} (polled by frontend) Frontend: - peaks store polled at 100 ms via setInterval; starts/stops with initGraph/destroyGraph - Each node card grows 8 px and shows a 3 px meter bar at the bottom (green below -12 dB, yellow -12 to -3 dB, red above -3 dB) Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/GraphCanvas.svelte | 21 ++- frontend/src/lib/stores.ts | 22 +++ src/graph_engine.cpp | 148 ++++++++++++++++++++- src/graph_engine.h | 30 +++++ src/web_server.cpp | 15 +++ 5 files changed, 232 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/GraphCanvas.svelte b/frontend/src/components/GraphCanvas.svelte index e450afa..b6436df 100644 --- a/frontend/src/components/GraphCanvas.svelte +++ b/frontend/src/components/GraphCanvas.svelte @@ -1,7 +1,7 @@