Phase 3 (WA2a): move WebOnMic into the web adapter

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>
This commit is contained in:
Uladzimir Karpenka
2026-06-08 16:15:52 +03:00
co-authored by Claude Opus 4.8
parent 2f8b0bdf48
commit 06fd730ff4
2 changed files with 22 additions and 20 deletions
+21
View File
@@ -86,6 +86,9 @@ type
procedure OnTun(On_: Boolean);
procedure OnFMStep(Idx: Integer);
procedure OnClientActiveChanged(Active: Boolean);
// TX-mic от web-клиента → WDSP. Вызывается из WS-потока; без маршалинга —
// подача в движок thread-safe (как OnMicPacket/OnDDCIQ контроллера).
procedure OnMic(Samples: PSingle; Count: Integer);
end;
implementation
@@ -261,4 +264,22 @@ begin
FController.FWebClientActive := Active;
end;
procedure TWebAdapter.OnMic(Samples: PSingle; Count: Integer);
var
Buf: array[0..5759] of Double;
SP: PSingle;
i, n: Integer;
begin
if not FController.FWDSPReady then Exit;
n := Count;
if n > Length(Buf) then n := Length(Buf);
SP := Samples;
for i := 0 to n - 1 do
begin
Buf[i] := SP^;
Inc(SP);
end;
FController.FDSPEngine.PushTXMicSamplesD(Buf, n);
end;
end.