mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 06:01:56 -07:00
fix: Add LISTEN button to listening post function strip and clarify controls
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1120,8 +1120,11 @@
|
||||
</div>
|
||||
<div class="strip-divider"></div>
|
||||
<!-- Actions -->
|
||||
<button type="button" class="strip-btn primary" id="listeningStripStartBtn" onclick="startListeningFromStrip()">
|
||||
▶ START
|
||||
<button type="button" class="strip-btn primary" id="listeningStripListenBtn" onclick="listenFromStrip()" title="Tune to frequency and listen">
|
||||
🎧 LISTEN
|
||||
</button>
|
||||
<button type="button" class="strip-btn" id="listeningStripScanBtn" onclick="startListeningFromStrip()" title="Scan frequency range for signals">
|
||||
📡 SCAN
|
||||
</button>
|
||||
<button type="button" class="strip-btn stop" id="listeningStripStopBtn" onclick="stopListening()" style="display: none;">
|
||||
◼ STOP
|
||||
|
||||
Reference in New Issue
Block a user