mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
Decouple MainForm from CAT/Web by introducing a headless core, TRadioController, as the single home for radio state and engine objects. This is groundwork for swappable UIs, a daemon (Web-only) mode, and a future hardware control panel — each becomes a frontend/adapter over the same controller API. RadioController.pas (new): - Radio state + engine objects (Network/DSP/Audio/Settings/Channels) as public fields named exactly as in MainForm, so wiring is mechanical. - Command API: absolute Set* plus relative *By/Up/Down (for encoders). - OnStateChanged(field) notifications and GetSnapshot for frontend sync. - Invoke/OnInvoke (TUIInvokeEvent) thread-marshalling seam (GUI uses TThread.Synchronize; daemon supplies its own). - Commands are scaffolding for now (update field + fire event); engine logic stays in MainForm and migrates in later phases (TODO-wiring). MainForm.pas: - Owns FController; creates it first in FormCreate, frees it last in FormDestroy. Engines are still created/freed by MainForm into the controller's fields (ownership move is a later phase). - ~1400 FXxx references redirected to FController.FXxx (implementation only); dead field declarations removed from the interface. No behavioral change — pure state relocation. Builds clean (cocoa). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
733 B
ObjectPascal
34 lines
733 B
ObjectPascal
program ewsdr;
|
|
|
|
{$IFDEF FPC}
|
|
{$MODE Delphi}
|
|
{$ENDIF}
|
|
|
|
// Без этого на Windows запускается консольное окно
|
|
{$IFDEF WINDOWS}
|
|
{$APPTYPE GUI}
|
|
{$ENDIF}
|
|
|
|
uses
|
|
{$IFDEF UNIX}
|
|
cthreads,
|
|
{$ENDIF}
|
|
Interfaces, // LCL platform
|
|
WindowsDPI,
|
|
Forms, LazOpenGLContext,
|
|
MainForm, AudioOutput, DeviceForm, FlatButton, FreqDisplay, VfoOverlay,
|
|
WDSP, WDSPEngine, WebPageHtml, WebServer, WebUtils, WinFirewall, WsClient,
|
|
Settings, RadioController;
|
|
|
|
{$R *.res}
|
|
|
|
begin
|
|
EnableProcessDpiAwareness;
|
|
RequireDerivedFormResource := True;
|
|
Application.Title:='EWSDR';
|
|
Application.Scaled:=True;
|
|
Application.Initialize;
|
|
Application.CreateForm(TMainForm, MainForm.MainForm);
|
|
Application.Run;
|
|
end.
|