OnSpectrumReady/OnWaterfallReady move into TRadioController. The controller now
owns the last spectrum/waterfall frame (FSpectrumBuf/FWaterfallBuf) for the web
mirror and emits raw pixels via OnSpectrumData/OnWaterfallData. MainForm
subscribes for FSpecView rendering (+ waterfall scroll decimation, a UI concern).
TWebAdapter.PushState now reads the frame from the controller (no buffer params).
Behavior-preserving; removes the last spectrum/waterfall data-path coupling.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
OnAudioReady moves from MainForm into TRadioController (radio-speaker push +
local AudioOut). The web steal becomes a route hook: controller fires
OnAudioConsume; TWebAdapter.AudioConsume mixes to mono and pushes to the web
client, returning True to skip local AudioOut. Behavior-preserving; removes the
last audio-path coupling to MainForm.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SetBand was a skeleton (FCurrentBand := Idx + Changed), leaving BandUp/BandDown
non-functional. Fill it with the band-change logic (XVTR-exit + persist + restore)
that WebAdapter.SyncBand had inline; SyncBand now just calls FController.SetBand.
Gives CAT band up/down/by-index a controller command to call (Phase 4) instead of
routing through the web adapter.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With ApplyVfoA now a thin SetVfoA delegate (channel orchestration on the
OnAfterTune hook), the web Freq/FreqA handlers carry no MainForm logic — move
them to TWebAdapter.OnFreq (active-VFO routing → SetVfoA/SetVfoB) and OnFreqA
(SetVfoA). CAT freq (CATSetVfoA/SyncCATVfoA) left as-is — moves with the CAT
adapter (Phase 4).
Remaining host-coupled web handlers: Run / Connect / device CRUD (daemon entry).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that RestoreBand and XVTR enter/exit are full controller commands, the web
Band and XvtrBand handlers carry no MainForm orchestration — move them to
TWebAdapter.OnBand/OnXvtrBand (validation + SaveCurrentBand/persist + command).
CAT Ctx.DoBandByIndex and CAT band up/down repointed to FWebAdapter.OnBand.
Remaining host-coupled web handlers: Freq/FreqA (ApplyVfoA channel orchestration),
Run/Connect/device CRUD (daemon entry).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that global-settings persistence is controller-owned, fold the persist into
SetSampleRate (sample rate is global; self-gated on FDevConnected). OnSampleRateSelect
becomes a thin wrapper. Web Span moves to TWebAdapter.OnSpan (keeps the valid-span
whitelist), so the last span coupling to MainForm is gone.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The per-tick PushSpectrum mirror (status strings + ~40 state values + spectrum/
waterfall buffers) moves out of SpectrumTimerTick into TWebAdapter.PushState,
which reads FController for everything and takes the pixel buffers as params.
MainForm's timer now just calls FWebAdapter.PushState(FSpectrumBuf, FWaterfallBuf).
Server lifecycle/ownership stays in MainForm for now — it's still driven by the
remaining host-coupled handlers (PushXvtrToWeb, device CRUD); ownership transfer
completes when those move.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that SetDrive is a complete command, the web/CAT Drive handler moves into
TWebAdapter.OnDrive (the one handler WA1 left behind). CAT context SetDriveLevel
repointed to it too.
Makes the channel-power-clear reactive: ChannelController.OnDriveChanged fires on
the rfDrive event and clears FPreChannelPower for any external drive change
(slider/web/encoder), guarded by FRestoringDrive for the unit's own apply/restore.
This removes the imperative ClearPreChannelPower coupling so SetDrive callers need
no channel knowledge.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
WebOnMic only feeds TX mic samples to the controller's WDSP engine
(no UI, thread-safe like the other engine data callbacks), so it moves
verbatim into TWebAdapter.OnMic. FWebServer.OnWebMic now points there.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the pure controller-command web handlers out of MainForm into a
new TWebAdapter (bridge between TWebServer and TRadioController),
marshalling via FController.Invoke so it is daemon-ready.
- 20 handlers moved: Mode/Filter/AGC/AGCTop/Volume/WfAGC/WfNF/Mute/
NR/NB/SNB/ANF/FreqB/Center/Attn/ActiveVfo/Ctun/MOX/Tun/FMStep +
ClientActiveChanged. Each calls a controller command directly.
- CAT context (Ctx.Set*) and CATSetFilterIdx repointed to the adapter,
since CAT reuses these as its command layer.
- Host-dependent handlers (Freq/Band/XvtrBand/Span/Run/Drive/connect/
disconnect/CRUD/mic) and the outgoing PushSpectrum mirror stay in
MainForm for now (WA2/WA3); IWebHost is the placeholder seam.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>