From 24f16b2cd9e4e165aafc411e524c006d067d8b86 Mon Sep 17 00:00:00 2001 From: gramps Date: Sat, 15 Aug 2026 15:53:51 -0700 Subject: [PATCH] Game audio bar is now ALWAYS visible (TASK 4 gating removed, 2026-08-15): the show/hide machinery kept hiding the desktop/game meter whenever no full-screen game with sound was up or no TRAX music played, which the creator read as the meter being lost. Deleted IGameAudioDetector/GameAudioDetector/GameAudioHysteresis (Services/), the VM's 250ms DispatcherTimer poll + OnGameAudioActiveChanged/OnGameAudioPollTick + IsGameAudioBarVisible + _gameAudioBarActive/_gameAudioTimer/_gameAudioDetector, and the two detector test files (GameAudioDetectorTests, GameAudioHysteresisTests); MainWindow.xaml drops the Visibility binding so the bar renders unconditionally. Desktop audio is just automatic WASAPI loopback now. Docs in the same commit: ai.md (audio section + Services inventory), Services/index.md, ViewModels/index.md, TASKS.md TASK 9 item 7 follow-up, HANDOFF.md shipped state + stale poll-timer landmine removed. Build 0 warnings, 189 tests passing (8 detector tests removed) --- HANDOFF.md | 31 +++++++-- MainWindow.xaml | 14 ++-- Services/GameAudioDetector.cs | 46 ------------- Services/GameAudioHysteresis.cs | 57 ---------------- Services/IGameAudioDetector.cs | 20 ------ Services/index.md | 3 - TASKS.md | 2 +- ViewModels/MainViewModel.cs | 40 +----------- ViewModels/index.md | 2 +- ai.md | 10 +-- ytLive.Tests/GameAudioDetectorTests.cs | 76 ---------------------- ytLive.Tests/GameAudioHysteresisTests.cs | 82 ------------------------ 12 files changed, 38 insertions(+), 345 deletions(-) delete mode 100644 Services/GameAudioDetector.cs delete mode 100644 Services/GameAudioHysteresis.cs delete mode 100644 Services/IGameAudioDetector.cs delete mode 100644 ytLive.Tests/GameAudioDetectorTests.cs delete mode 100644 ytLive.Tests/GameAudioHysteresisTests.cs diff --git a/HANDOFF.md b/HANDOFF.md index 8aad425..1c2fe5e 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -7,11 +7,17 @@ ## Session state (last updated: 2026-08-15) -- **Branch:** `main`, tracking `origin/main`. Working tree: the **TASK 24 polish batch** below is - committed + pushed. Local branches `social-bar`/`webcam-validation` untouched (no secrets). +- **Branch:** `main`, tracking `origin/main`. Working tree: the **TASK 24 polish batch** + the **game + audio bar always-visible change** (below) are committed + pushed. Local branches + `social-bar`/`webcam-validation` untouched (no secrets). +- **GAME AUDIO BAR ALWAYS VISIBLE — COMMITTED + PUSHED 2026-08-15.** The TASK 4 show/hide gating was a + UX bug: the desktop/game meter kept vanishing whenever no full-screen game with sound was up (or no + TRAX music played). The whole `IGameAudioDetector`/`GameAudioDetector`/`GameAudioHysteresis` stack + + the VM's 250ms poll timer + its two test files were **deleted**; the bar is now permanently overlaid + at the bottom of the preview. Build **0 warnings**, full suite green. - **TASK 24 — POST-PAUSE POLISH BATCH — SHIPPED + COMMITTED + PUSHED 2026-08-15.** All 8 creator review issues fixed in one branch (details below). Build **0 warnings**, full suite **197 passing** - (ONE integration test for this branch: `AudioPipelineTests.Mix_HonorsProviderGains_AndGameMute_KillsTheLoopback`). + (ONE integration test for that branch: `AudioPipelineTests.Mix_HonorsProviderGains_AndGameMute_KillsTheLoopback`). - **AUDIO MILESTONE (TASK 9) — SHIPPED + COMMITTED + PUSHED.** Real stream audio + voice filters + auto-duck + free TRAX background music. Commits `6d71ace` (milestone) + `f2f6401` (secrets cleanup), force-pushed (`725f5a7...f2f6401`). @@ -61,6 +67,23 @@ The creator's review of the TASK 9 build, all fixed in one branch (full record i **THE ONE integration test:** `Mix_HonorsProviderGains_AndGameMute_KillsTheLoopback` — real mixer + `AudioGainProvider` gains through the pipe harness: scaled loopback audible at 0.5, silence after mute. +## Game audio bar — always visible 2026-08-15 (what changed) + +The creator reported the desktop/game sound meter "lost" — it was the TASK 4 show/hide gating +(`_gameAudioBarActive || IsMusicPlaying`): the bar only rendered while a full-screen game produced +sound or TRAX played, so it sat hidden during normal use. Fix = the bar is now **always visible**: + +- **Deleted** `Services/IGameAudioDetector.cs`, `Services/GameAudioDetector.cs`, + `Services/GameAudioHysteresis.cs`, `ytLive.Tests/GameAudioDetectorTests.cs`, + `ytLive.Tests/GameAudioHysteresisTests.cs` — the stack's only output (`_gameAudioBarActive`) fed + `IsGameAudioBarVisible`, which no longer exists. +- **MainViewModel.cs:** removed `_gameAudioTimer` (250ms `DispatcherTimer`), `_gameAudioDetector`, + `_gameAudioBarActive`, the constructor wiring, `OnGameAudioActiveChanged`, `OnGameAudioPollTick`, + `IsGameAudioBarVisible`, and the `IsMusicPlaying` → visibility notification. Desktop audio is just + automatic WASAPI loopback now. +- **MainWindow.xaml:** dropped the `Visibility` binding on the preview-overlay game bar; it renders + unconditionally (TRAX button + "Desktop Audio" label + meter + mute + volume unchanged). + ## TASK 9 audio milestone — SHIPPED 2026-08-14 (what changed) The creator's feature review settled this as the single next branch ("all the audio issues done and @@ -108,8 +131,6 @@ track (YouTube mutes VODs with copyrighted music — future feature), `PremiumUr only after `Started`, yellow on `Failed`. - Zero mic devices at startup = red dot AND the mixer is never started, so loopback + the game bar can't run either (no capture at all) — acceptable. - - The game detector is polled on the UI thread via a 250ms `DispatcherTimer`; - `OnGameAudioPollTick` wraps `Poll()` in try/catch + `AppLog`. - The pump reads the active scene on a background thread while the UI can still edit it — a concurrent-mutation exception is contained (logged + `Failed` + the pump stops), not a crash. diff --git a/MainWindow.xaml b/MainWindow.xaml index 4d0d956..570db6d 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -754,16 +754,14 @@ + preview, always visible. Meter + mute + volume control + live here; desktop audio itself is automatic WASAPI + loopback. Volume + mute are stream-honest AND scale the + TRAX music in the headphones, so the creator hears the + control work. --> + Margin="0,0,0,12">