From d0e8eaf3971a9cecda029796ec4300ef09f7a989 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 30 Jan 2026 21:20:17 +0000 Subject: [PATCH] fix: Add LISTEN button to listening post function strip and clarify controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add dedicated LISTEN button (🎧) to function strip for direct audio playback - Rename START to SCAN (📡) to clarify it scans for signals, not direct audio - Update function strip status to show LISTENING (green) vs SCANNING (cyan) - Update updateListeningStripRunning() to accept mode parameter - Add listenFromStrip() function for direct audio from function strip - Update stopListening() to handle both scanner and audio states - Move .listening status dot to green color group (matches audio state) This clarifies the confusion where users expected the START button to play audio, but it actually started the frequency scanner which only plays audio when signals are detected. Co-Authored-By: Claude Opus 4.5 --- static/css/components/function-strip.css | 2 +- static/js/modes/listening-post.js | 60 ++++++++++++++++++++---- templates/index.html | 7 ++- 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/static/css/components/function-strip.css b/static/css/components/function-strip.css index a1a944f..492be77 100644 --- a/static/css/components/function-strip.css +++ b/static/css/components/function-strip.css @@ -221,13 +221,13 @@ } .function-strip .status-dot.active, -.function-strip .status-dot.listening, .function-strip .status-dot.scanning, .function-strip .status-dot.decoding { background: var(--accent-cyan); animation: strip-pulse 1.5s ease-in-out infinite; } +.function-strip .status-dot.listening, .function-strip .status-dot.tracking, .function-strip .status-dot.receiving { background: var(--accent-green); diff --git a/static/js/modes/listening-post.js b/static/js/modes/listening-post.js index ceb5a2b..b5e2364 100644 --- a/static/js/modes/listening-post.js +++ b/static/js/modes/listening-post.js @@ -2247,6 +2247,15 @@ function updateDirectListenUI(isPlaying, freq) { if (quickFreq && freq) { quickFreq.textContent = freq.toFixed(3) + ' MHz'; } + + // Update function strip + updateListeningStripRunning(isPlaying, 'listen'); + + // Update strip frequency display + if (freq) { + const stripFreq = document.getElementById('listeningStripFreq'); + if (stripFreq) stripFreq.textContent = freq.toFixed(3); + } } /** @@ -2616,21 +2625,23 @@ window.exportScannerLog = exportScannerLog; /** * Update the listening post function strip running state */ -function updateListeningStripRunning(running) { +function updateListeningStripRunning(running, mode = 'scan') { const listeningStripDot = document.getElementById('listeningStripDot'); const listeningStripStatus = document.getElementById('listeningStripStatus'); - const listeningStripStartBtn = document.getElementById('listeningStripStartBtn'); + const listeningStripListenBtn = document.getElementById('listeningStripListenBtn'); + const listeningStripScanBtn = document.getElementById('listeningStripScanBtn'); const listeningStripStopBtn = document.getElementById('listeningStripStopBtn'); const listeningStripFreqInput = document.getElementById('listeningStripFreqInput'); const listeningStripMode = document.getElementById('listeningStripMode'); const listeningStripGain = document.getElementById('listeningStripGain'); - if (listeningStripDot) listeningStripDot.className = 'status-dot ' + (running ? 'scanning' : 'inactive'); + if (listeningStripDot) listeningStripDot.className = 'status-dot ' + (running ? (mode === 'listen' ? 'listening' : 'scanning') : 'inactive'); if (listeningStripStatus) { - listeningStripStatus.textContent = running ? 'SCANNING' : 'STANDBY'; - listeningStripStatus.style.color = running ? 'var(--accent-cyan)' : ''; + listeningStripStatus.textContent = running ? (mode === 'listen' ? 'LISTENING' : 'SCANNING') : 'STANDBY'; + listeningStripStatus.style.color = running ? (mode === 'listen' ? 'var(--accent-green)' : 'var(--accent-cyan)') : ''; } - if (listeningStripStartBtn) listeningStripStartBtn.style.display = running ? 'none' : 'inline-block'; + if (listeningStripListenBtn) listeningStripListenBtn.style.display = running ? 'none' : 'inline-block'; + if (listeningStripScanBtn) listeningStripScanBtn.style.display = running ? 'none' : 'inline-block'; if (listeningStripStopBtn) listeningStripStopBtn.style.display = running ? 'inline-block' : 'none'; if (listeningStripFreqInput) listeningStripFreqInput.disabled = running; if (listeningStripMode) listeningStripMode.disabled = running; @@ -2677,15 +2688,48 @@ function startListeningFromStrip() { } /** - * Stop listening from the function strip + * Listen directly from the function strip (audio only, no scanning) + */ +function listenFromStrip() { + // Get values from strip + const freq = document.getElementById('listeningStripFreqInput')?.value; + const mode = document.getElementById('listeningStripMode')?.value; + const gain = document.getElementById('listeningStripGain')?.value; + + // Update the main controls if they exist + if (freq) { + const mainFreqInput = document.getElementById('radioScanStart'); + if (mainFreqInput) mainFreqInput.value = freq; + } + if (mode) { + currentModulation = mode.toLowerCase(); + } + if (gain) { + const gainValueEl = document.getElementById('radioGainValue'); + if (gainValueEl) gainValueEl.textContent = gain; + } + + // Start direct audio listening + toggleDirectListen(); +} + +/** + * Stop listening/scanning from the function strip */ function stopListening() { - stopScanner(); + // Stop both scanner and audio + if (isScannerRunning) { + stopScanner(); + } + if (isDirectListening) { + stopDirectListen(); + } } // Export strip functions window.updateListeningStripRunning = updateListeningStripRunning; window.updateListeningStrip = updateListeningStrip; window.startListeningFromStrip = startListeningFromStrip; +window.listenFromStrip = listenFromStrip; window.stopListening = stopListening; diff --git a/templates/index.html b/templates/index.html index af8415c..a497364 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1120,8 +1120,11 @@
- +