fix: all dummy data replaced with real API data

- Status bar: CPU load + sample rate from /api/state, TUNER badge shown immediately
- Rig: optimistic toggle updates (bypass/tuner respond instantly), prominent tuner card
- FX Chain: loads real block params from /api/block-params/{fx_type}, Add Block picker with all FX types
- Record: replaced fake multitrack with real Signal Monitor (live I/O VU, clip detect, level history)
- Backend: added _gather_system_stats() returning cpu_percent and sample_rate
This commit is contained in:
2026-06-12 17:16:03 -04:00
parent 7498ad55fc
commit 2a30592ab3
5 changed files with 405 additions and 288 deletions
+19 -1
View File
@@ -29,7 +29,7 @@ from fastapi.templating import Jinja2Templates
from ..dsp.nam_host import NAMHost
from ..dsp.ir_loader import IRLoader
from ..dsp.pipeline import AudioPipeline
from ..dsp.pipeline import AudioPipeline, SAMPLE_RATE
from ..presets.manager import PresetManager
from ..presets.types import FXBlock, FXType, Preset
from ..system.tonedownload import (
@@ -1001,6 +1001,19 @@ class WebServer:
"address": None, "discoverable": False,
"midi_enabled": False, "midi_running": False}
# ── System state gathering ────────────────────────────────────
def _gather_system_stats(self) -> dict:
"""Gather system stats (CPU, audio config) without hard-failing."""
try:
import psutil
return {
"cpu_percent": psutil.cpu_percent(interval=None),
"sample_rate": SAMPLE_RATE if hasattr(self, 'deps') and self.deps.pipeline else 48000,
}
except Exception:
return {"cpu_percent": 0, "sample_rate": 48000}
# ── State gathering ──────────────────────────────────────────────
def _gather_state(self) -> dict[str, Any]:
@@ -1025,6 +1038,8 @@ class WebServer:
"ir_name": None,
"input_level": 0,
"output_level": 0,
"cpu_percent": 0,
"sample_rate": 48000,
"wifi": {},
"bluetooth": {},
}
@@ -1070,6 +1085,9 @@ class WebServer:
# Audio levels from pipeline (RMS float32 normalized 0.0-1.0, scaled to 0-100)
"input_level": min(100, round((pl._input_level or 0.0) * 150)) if pl else 0,
"output_level": min(100, round((pl._output_level or 0.0) * 150)) if pl else 0,
# System stats
"cpu_percent": self._gather_system_stats().get("cpu_percent", 0),
"sample_rate": SAMPLE_RATE,
"wifi": self._gather_wifi_state(),
"bluetooth": self._gather_bt_state(),
}