From 235129d0d6890c61c24ec79fac9e084009a46846 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Sat, 11 Jul 2026 00:27:03 -0500 Subject: [PATCH] feat(ui): track microphone level separately in the recording store --- src/lib/stores/recording.svelte.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/lib/stores/recording.svelte.ts b/src/lib/stores/recording.svelte.ts index 414f670..03a1add 100644 --- a/src/lib/stores/recording.svelte.ts +++ b/src/lib/stores/recording.svelte.ts @@ -12,9 +12,13 @@ class RecordingStore { segments = $state([]); /** Whether audio is being retained as .wav for the in-flight meeting (ADR-0009). */ retention = $state(false); - /** Live input level for the waveform/meter (FR-CAP-5); 0 when not recording. */ + /** Live system/loopback level for the waveform/meter (FR-CAP-5); 0 when not recording. */ levelRms = $state(0); levelPeak = $state(0); + /** Live microphone level, overlaid on the meter in a different colour + * (FR-CAP-7); stays 0 when the mic is disabled or not recording. */ + levelRmsMic = $state(0); + levelPeakMic = $state(0); /** Set while a capture-device reconnect is in progress; cleared on recovery (FR-CAP-6). */ deviceNotice = $state(null); /** Live notes redesign: freeform text typed in the Notes pane while recording. */ @@ -35,6 +39,8 @@ class RecordingStore { if (ended) { this.levelRms = 0; this.levelPeak = 0; + this.levelRmsMic = 0; + this.levelPeakMic = 0; } }); await events.onRetention((p) => { @@ -46,9 +52,14 @@ class RecordingStore { if (i >= 0) this.segments[i] = segment; else this.segments.push(segment); }); - await events.onLevel(({ rms, peak }) => { - this.levelRms = rms; - this.levelPeak = peak; + await events.onLevel(({ rms, peak, mic }) => { + if (mic) { + this.levelRmsMic = rms; + this.levelPeakMic = peak; + } else { + this.levelRms = rms; + this.levelPeak = peak; + } }); await events.onDeviceChanged(({ recovered, message }) => { this.deviceNotice = recovered ? null : message; @@ -76,6 +87,8 @@ class RecordingStore { this.state = "idle"; this.levelRms = 0; this.levelPeak = 0; + this.levelRmsMic = 0; + this.levelPeakMic = 0; this.deviceNotice = null; } @@ -91,6 +104,8 @@ class RecordingStore { this.state = "idle"; this.levelRms = 0; this.levelPeak = 0; + this.levelRmsMic = 0; + this.levelPeakMic = 0; this.deviceNotice = null; this.notesText = ""; this.segmentNotes.clear();