mirror of
https://github.com/got-feedBack/feedBack-desktop.git
synced 2026-09-12 03:08:11 +00:00
fix(audio): refcounted monitor-mute arbiter (TLC Part II §2)
The old single monitorMuted atomic had five writers fighting last-writer-wins: the settings checkbox, startup restore, the executor's preload read-force-restore, releaseRoute's unconditional setMonitorMute(true) (which clobbered the user's persisted preference), and the renderer's song-load suppression (un-refcounted — overlapping windows un-suppressed each other early). Native arbiter on SourceChain: userMonitorMute (the preference — checkbox + restore only), refcounted monitorMuteHolds (force-mute overrides), and refcounted suppressions (setMonitorMuteSuppressed keeps its bool surface; true=acquire, false=release, clamped at 0). Effective dry-mute = (holds || pref) && chain empty && no suppression — the suppressed-beats-muted precedence is unchanged. New exports: acquire/releaseMonitorMuteHold, getMonitorMuteState (diag); snapshots regenerated. Executor rewrite: acquires a suppression (dry-during-load, the default) or a hold, and releases exactly what it acquired via a single-fire closure that runs UNCONDITIONALLY (each load owns its acquisition — the stale-snapshot race against a mid-hold user toggle is structurally gone). releaseRoute no longer touches mute state at all. The ownership test now pins: preference API never called, acquire/release balanced. Renderer callers are unchanged: the checkbox writes the preference as before, and the song-load suppression sites now compose instead of racing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
2906d2814b
commit
88f881dd1e
@@ -165,6 +165,11 @@ public:
|
||||
// so the brief empty-chain window doesn't silence the player's guitar.
|
||||
void setMonitorMuteSuppressed(bool suppressed) { source0().setMonitorMuteSuppressed(suppressed); }
|
||||
bool isMonitorMuteSuppressed() const { return source0().isMonitorMuteSuppressed(); }
|
||||
// Refcounted force-mute overrides (see SourceChain's arbiter comment).
|
||||
void acquireMonitorMuteHold() { source0().acquireMonitorMuteHold(); }
|
||||
void releaseMonitorMuteHold() { source0().releaseMonitorMuteHold(); }
|
||||
int getMonitorMuteHoldCount() const { return source0().getMonitorMuteHoldCount(); }
|
||||
int getMonitorMuteSuppressCount() const { return source0().getMonitorMuteSuppressCount(); }
|
||||
|
||||
// Full monitor kill — silences the guitar bus entirely (dry + processed),
|
||||
// for monitoring through an external rig. Unlike the per-source mute/gain
|
||||
|
||||
Reference in New Issue
Block a user