Skip to content

RadioModel: track CWX active state to keep audio gate open during send#2181

Merged
ten9876 merged 1 commit into
mainfrom
aether/cwx-active-tracking
Apr 30, 2026
Merged

RadioModel: track CWX active state to keep audio gate open during send#2181
ten9876 merged 1 commit into
mainfrom
aether/cwx-active-tracking

Conversation

@ten9876

@ten9876 ten9876 commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Carves out the substantive CWX-tracking part of PR #2103 (which had a merge conflict because its other change — startSidetoneStream() in AudioEngine — landed earlier today via PR #2105).

What was wrong

When CWX is sending, the radio enters TRANSMITTING via CW keying. The interlock handler in RadioModel::onStatusReceived gates m_txAudioGate based on whether we believe we're the source of TX:

if (!m_txOwnedByUs || (!m_txRequested && !m_cwKeyActive && !m_transmitModel.isTuning())) {
    // force local TX/audio gate off
}

For CWX there was no signal that the local CWX queue is in flight, so this check thought we were a passive observer of someone else's TX and forced the gate off — silencing local sidetone.

What changed

Added m_cwxActive flag:

  • Set in the cwxModel.commandReady lambda when cwx send or cwx macro send is dispatched
  • Cleared on cwx clear and on radio state leaving TRANSMITTING (with the existing setTransmitting(false) path)
  • Cleared on disconnect alongside the other interlock state

The interlock guard now reads !m_cwxActive so CWX-driven TX keeps the audio gate open.

Provenance

This is the RadioModel.cpp/h changes from PR #2103 (authored by AetherClaude bot), replayed by hand. The AudioEngine.cpp portion of #2103 (startSidetoneStream() call) was the same line PR #2105 added; that's already on main, so it's omitted here.

Test plan

  • Build clean
  • CI green
  • On-air: Windows user with CW mode + CWX panel → enter message → click Send → local sidetone audible

🤖 Generated with Claude Code

When CWX is sending (the user pressed Send in the CWX window or fired
a macro), the radio enters TRANSMITTING via CW keying.  The interlock
handler at onStatusReceived gates m_txAudioGate based on whether we
believe we're the source of TX — but for CWX it had no signal that
the local CWX queue is in flight, so the gate was forced off and the
local sidetone path silenced.

Adds an m_cwxActive flag, set in the cwxModel commandReady lambda
when "cwx send" / "cwx macro send" goes out and cleared on "cwx clear"
or when the radio leaves the transmitting state.  The interlock guard
now includes !m_cwxActive in the "should we force gate off" check.

Carved out from PR #2103 (which also added a now-redundant
startSidetoneStream() call in AudioEngine — already landed via PR
#2105 / commit c906165).  This PR contains only the substantive
CWX-tracking changes.

Fixes #2097.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant