mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-26 04:47:35 +00:00
Phase 3 (batch 6): route FM squelch + CTCSS through controller commands
The user plans to expose FM over web/CAT later, so FM controls get the same controller treatment now — future web/CAT FM commands plug straight into these. - Relocate CTCSS_COUNT/CTCSS_TONES from MainForm to FMRepeater (a shared FM unit MainForm already uses) so TRadioController can drive CTCSS on the DSP. CTCSS_NAMES stays in MainForm (UI dropdown labels). MODE_FM is already visible to the controller via WDSPEngine. - SetFMSquelch/SetFMSquelchLevel apply FM squelch (mode-gated) to the DSP; SetFMCTCSS/SetFMCTCSSTone clamp and apply CTCSS. All fire OnStateChanged. - OnControllerState restyles the SQ/CTCSS buttons, syncs the squelch slider + label, and the CTCSS tone dropdown. Handlers/SetFMCTCSSTone call the commands (manual CTCSS still clears the auto-active flag in the handler). FM repeater stays for the heavy batch — it needs XvtrTranslate/ ActiveTXFreqHz moved into the controller. ApplyFMSquelch remains for band/mode re-apply paths (RestoreBand, XVTR). Builds clean (cocoa). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7d3570346f
commit
fd145b28f6
+26
-5
@@ -50,7 +50,7 @@ uses
|
||||
Classes, SysUtils,
|
||||
HPSDRProtocol, HPSDRNetwork,
|
||||
WDSPEngine, AudioOutput, AudioInput,
|
||||
Settings, ChannelStore;
|
||||
Settings, ChannelStore, FMRepeater;
|
||||
|
||||
type
|
||||
// Поле, которое изменилось — для гранулярных уведомлений наружу.
|
||||
@@ -523,16 +523,37 @@ begin
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetFMCTCSS(On_: Boolean);
|
||||
begin FFMCTCSSOn := On_; Changed(rfFMCTCSS); { TODO wiring } end;
|
||||
begin
|
||||
FFMCTCSSOn := On_;
|
||||
if FWDSPReady and Assigned(FDSPEngine) then
|
||||
FDSPEngine.SetTXCTCSS(FFMCTCSSOn, CTCSS_TONES[FFMCTCSSToneIdx]);
|
||||
Changed(rfFMCTCSS);
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetFMCTCSSTone(Idx: Integer);
|
||||
begin FFMCTCSSToneIdx := Idx; Changed(rfFMCTCSSTone); { TODO wiring } end;
|
||||
begin
|
||||
if Idx < 0 then Idx := 0 else if Idx > CTCSS_COUNT - 1 then Idx := CTCSS_COUNT - 1;
|
||||
FFMCTCSSToneIdx := Idx;
|
||||
if FWDSPReady and Assigned(FDSPEngine) then
|
||||
FDSPEngine.SetTXCTCSS(FFMCTCSSOn, CTCSS_TONES[FFMCTCSSToneIdx]);
|
||||
Changed(rfFMCTCSSTone);
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetFMSquelch(On_: Boolean);
|
||||
begin FFMSQOn := On_; Changed(rfFMSQ); { TODO wiring } end;
|
||||
begin
|
||||
FFMSQOn := On_;
|
||||
if FWDSPReady and Assigned(FDSPEngine) then
|
||||
FDSPEngine.SetFMSquelch(FFMSQOn and (FMode = MODE_FM), FFMSQLevel);
|
||||
Changed(rfFMSQ);
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetFMSquelchLevel(V: Integer);
|
||||
begin FFMSQLevel := V; Changed(rfFMSQLevel); { TODO wiring } end;
|
||||
begin
|
||||
FFMSQLevel := V;
|
||||
if FWDSPReady and Assigned(FDSPEngine) then
|
||||
FDSPEngine.SetFMSquelch(FFMSQOn and (FMode = MODE_FM), FFMSQLevel);
|
||||
Changed(rfFMSQLevel);
|
||||
end;
|
||||
|
||||
procedure TRadioController.SetFMRpt(Dir: Integer);
|
||||
begin FFMRptDir := Dir; Changed(rfFMRpt); { TODO wiring } end;
|
||||
|
||||
Reference in New Issue
Block a user