Commit Graph
197 Commits
Author SHA1 Message Date
ew8bakandClaude Sonnet 4.6 1175e42516 Add channel memory: CH button, dropdown, editor form, smart CTCSS/RPT auto-clear
- New ChannelStore.pas: TChannel record + JSON persistence (channels.json)
- New ChannelsForm.pas: full channel editor (list + fields, pre-fills from current radio state)
- CH button in RX block: left-click opens dropdown, right-click opens editor
- Active channel: button highlights with channel name, deactivates on VFO move
- ApplyChannel: auto-switches XVTR/HF band based on channel frequency; saves old
  band state before switching to prevent cache corruption
- SaveCurrentBand: skip save when VFO > 61 MHz (prevents HF cache corruption
  from VHF channel application without XVTR)
- DeactivateXvtr: save full XVTR state (was only saving LastFreq)
- CTCSS/RPT from channel marked as auto: cleared automatically when tuning away
  from channel frequency; survives band switches via FXvtrSettings auto-flags
- TXvtrEntry: add LastCTCSSAutoActive, LastFMRptAutoActive fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:39:37 +03:00
ew8bak d08317e835 fix UpdateRptAutoState 2026-05-27 13:47:52 +03:00
ew8bakandClaude Sonnet 4.6 e6f02db399 Reorganize left panel: add RX block, move AGC, fix DUP placement and panel restore
- Add PanelRXBlock between TX and Band with CTUN, VOL, NR/NB/SNB/ANF/MUTE
- Move AGC panel to sit directly below RX block for logical RX grouping
- Move DUP button into TX panel below MOX/TUN
- Rename PanelRX → PanelAGC to match its content
- Standardize block label top (2px) and first-control top (16px) across all
  panels: AGC, SQL, CTCSS, STEP were inconsistent
- Fix left panel width restore after hide: save actual DPI-scaled width before
  zeroing instead of hardcoding 232, preventing panel truncation on Win32 with
  display scaling enabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 12:37:47 +03:00
ew8bak 047c9b0997 Make VFO overlay more transparent 2026-05-27 09:53:41 +03:00
ew8bakandClaude Sonnet 4.6 dd9e0da29e Fix FM step snap: round to nearest instead of truncating down
(ClickFreq div StepHz)*StepHz always snapped downward; replaced with
((ClickFreq + StepHz/2) div StepHz)*StepHz so clicks above the midpoint
between two steps correctly snap to the higher one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:50:55 +03:00
ew8bakandClaude Sonnet 4.6 3b62a502e2 Fix audio device not restored in settings: suppress callbacks during RefreshAudioDevices
RefreshAudioDevices was firing OnRXDevChange/OnTXDevChange when restoring
the combo selection, which called ApplyAudioDevice(-1,'') and wiped
FAudioOutDevName/FAudioInDevName before LoadValues could use them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:47:35 +03:00
ew8bak 4a84cce6e2 Merge branch 'refactor/extract-modules'
Extract helpers out of MainForm into structured modules:
- BoardUtils: BoardTypeName, FreqToBandIdx (removes duplication with DeviceForm)
- WisdomBuilder: TWisdomBuildThread + TWisdomProgressDialog
- UISync: TDeviceFoundSync/TStatusUISync/TDDCSeqSync via callbacks
- PlatformUtils: HasOpenGLSpectrumSwitch, CurrentScreenDPI

Minor cleanup: unused local constants, stale comments in AudioOutput.
2026-05-26 19:38:50 +03:00
ew8bakandClaude Sonnet 4.6 f09c36074f Remove unused constants and clean up stale comments
- Remove TOP_VFO_BTN_H and VFO_BTN_W (unused local consts, compiler warned)
- Consolidate duplicate comment block in AudioOutput.WriteDouble
- Clean up AudioOutput callback comment header

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:38:20 +03:00
ew8bakandClaude Sonnet 4.6 1e7121f200 Move FreqToBandIdx to BoardUtils
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:26:32 +03:00
ew8bakandClaude Sonnet 4.6 9716b88b0c Extract helpers into BoardUtils, WisdomBuilder, UISync, PlatformUtils
- BoardUtils: BoardTypeName (removes duplication with DeviceForm)
- WisdomBuilder: TWisdomBuildThread + TWisdomProgressDialog
- UISync: TDeviceFoundSync/TStatusUISync/TDDCSeqSync via callbacks
  (avoids circular dependency, removes TObject casts)
- PlatformUtils: HasOpenGLSpectrumSwitch + CurrentScreenDPI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 19:15:51 +03:00
ew8bak aa252cb741 Move wideband OpenGL background to primitives 2026-05-26 18:26:13 +03:00
ew8bak daa8043a23 Render wideband spectrum with OpenGL primitives 2026-05-26 18:01:58 +03:00
ew8bak ae1a7d9a6d Add wideband spectrum fill option 2026-05-26 17:52:02 +03:00
ew8bak f61290ad3d Use WDSP analyzer for wideband 2026-05-26 17:25:07 +03:00
ew8bak e0d49c7bfa Add wideband display pane 2026-05-26 16:24:07 +03:00
ew8bak 762fad420e Guard OpenGL mode on native Wayland 2026-05-26 11:06:55 +03:00
ew8bak 08c5f0ddb7 Add OpenGL waterfall renderer 2026-05-25 20:41:06 +03:00
ew8bak 5090838563 Add OpenGL spectrum renderer 2026-05-25 20:16:37 +03:00
ew8bak 16c5f6d428 Align left panel button margins 2026-05-25 19:41:19 +03:00
ew8bakandClaude Sonnet 4.6 f87869cd91 Add FlatProgressBar — canvas-rendered cross-platform progress bar
Replaces TProgressBar in TWisdomProgressDialog with TFlatProgressBar,
drawn entirely via Canvas (plain rectangle, no native widget styling).
Dialog now receives the active TAppTheme so both dark and light themes
are applied consistently to background, label, and progress bar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 15:26:55 +03:00
ew8bak b02f81750a Add custom flat form controls 2026-05-25 14:43:05 +03:00
ew8bakandClaude Sonnet 4.6 685370c91f Snap frequency to FM step on spectrum/waterfall click when Step is enabled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:45:43 +03:00
ew8bakandClaude Sonnet 4.6 9028a8dac0 Fix window geometry save/restore: DPI scaling, position drift, maximized state
- LFM: Position = poDesigned (was poScreenCenter, overriding our restore)
- RestoreWindowBounds: remove position scaling (L,T invariant across DPI);
  scale size correctly per backend: LCLWin32 uses CurDPI/SavedDPI (physical px),
  Qt6/GTK/Cocoa use SavedDPI/CurDPI (logical px, inverse); fix min-size
  inflation on Qt6 (was MulDiv(900,DPI,96) which exceeds logical screen width
  at 150%+ scale, forcing window to 0,0)
- SaveWindowBounds moved from FormDestroy to FormClose while window is still
  stable; add guard for bogus RestoredLeft/Top values on Qt6 when maximized
- RestoreWindowBounds stores FRestoreL/T and re-applies position in AfterShowTick
  (200ms after show) when WM frame extents are already known to Qt, fixing the
  systematic right/down drift caused by unknown frame extents at FormCreate time
- Save and restore WindowState (maximized flag); skip AfterShowTick position
  re-apply when window is maximized

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 11:56:56 +03:00
ew8bakandClaude Sonnet 4.6 1eecd974fc Reduce timer-tick CPU load by removing per-tick ResizeSMeter and throttling AGC line updates
- Remove ResizeSMeter (Pango font measurement + multiple SetBounds) from 60 Hz timer tick;
  it is still called on actual resize events
- Throttle UpdateAGCLines WDSP API calls from 60 Hz to ~10 Hz (every 6 ticks)
- Optimize spectrum alpha-fix loop: write-only byte access instead of read-modify-write DWORD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 18:51:41 +03:00
ew8bak 03693dc0f4 Stub CAT serial on macOS 2026-05-24 16:31:49 +03:00
ew8bak ffb735756e Enable Windows DPI awareness 2026-05-24 16:29:13 +03:00
ew8bak 8624116f0c Fix window geometry scaling and close deadlock 2026-05-24 16:19:22 +03:00
ew8bak 0dc04ffcad Fix TX spectrum filter alpha accumulation 2026-05-24 16:03:48 +03:00
ew8bakandClaude Sonnet 4.6 3bfd9adf0d Fix spectrum invisible on win32 and mask WDSP FPU exceptions
SpectrumView: rewrite DrawSpectrumGradient to blend directly into
FSpectrumBitmap via ScanLine instead of TLazIntfImage+BitBlt (stale DC
on win32). Add alpha=$FF fixup pass so pf32bit Canvas.Draw renders via
StretchBlt not AlphaBlend. Remove FSpecGradImg/FSpecGradBmp fields.

MainForm: mask exZeroDivide/exInvalidOp in FormCreate so WDSP DLL
divide-by-zero does not crash the DSP thread on win32 (Qt6 already
masks FPU exceptions globally).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 13:51:13 +03:00
ew8bak c5f225332b Add audio buffer setting and optimize overlays 2026-05-22 18:07:05 +03:00
ew8bak 26aa55ddde Render sample rate overlay into spectrum bitmap 2026-05-22 17:15:29 +03:00
ew8bakandClaude Sonnet 4.6 ea6e57b8b8 Replace PanelSpanButtons with SampleRateOverlay overlay
- Add SampleRateOverlay.pas: TCustomControl overlay (top-left of spectrum)
  with hide-panel button and 6 span buttons (48k–1536k), same hit-test
  pattern as VfoOverlay
- Consolidate toolbar: move PanelTopVfoGroup and PanelSMeterRight into
  PanelToolbar (height 72) instead of floating on the form
- Remove PanelSpanButtons (alTop spacer) that caused the ~1cm black strip
  at the top of the spectrum
- Add separator line inside PanelToolbar anchored to its bottom edge,
  with 16px left/right margins
- Fix left panel blocks starting Y offset (was 38, now 0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 15:31:42 +03:00
ew8bakandClaude Sonnet 4.6 24ff61cb05 Add AGC picker to VfoOverlay DSP row
AGC button in DSP row shows current mode (FAST/MED/SLOW/LONG/OFF).
Click toggles a picker row below; selecting a mode closes it, fires
OnAGCChange, and syncs MainForm BtnAGCMode buttons and DSP engine.
Overlay height expands 136→159 px while picker is open.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 13:16:21 +03:00
ew8bakandClaude Sonnet 4.6 8193a2b598 Extract TFlatDropDown reusable dropdown component
Moves CTCSS tone picker and FM step picker from inline TPanel+TFlatButton
arrays into a standalone FlatDropDown.pas module. TFlatDropDown owns the
popup panel, handles positioning and item selection, and fires OnSelect.
ApplyStyle syncs button colors on theme change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 12:52:03 +03:00
ew8bakandClaude Sonnet 4.6 6b386a4a76 Add NR/NB/SNB/ANF DSP row to VfoOverlay
Third button row mirrors MainForm NR (cycle 0-4), NB (cycle 0-2),
SNB and ANF toggles. OnDSPChange event syncs state back to MainForm
buttons and DSP engine. Overlay height tightened to match top/bottom
padding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 12:40:04 +03:00
ew8bakandClaude Sonnet 4.6 5a74017e8a Fix VfoOverlay FM mode: NFM/FM filters, deviation sync, button layout
- FM filter row now shows only NFM (11 kHz) and FM (16 kHz) matching MainForm
- OnModeFilterSelect updates FFMDeviation and FFilter index for FM mode
- Mode and filter button widths distributed evenly (proportional, not fixed BtnW)
- S-meter inset by extra 4 px on each side

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 12:32:33 +03:00
ew8bakandClaude Sonnet 4.6 d99c19ec9a Split SpectrumView into WaterfallView, SMeterView, RulerView modules
TSpectrumView remains the public facade for MainForm; waterfall, S-meter,
and ruler rendering are now in isolated units. Dead code removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 11:16:55 +03:00
ew8bak dede74d0a5 Add web status bar fields 2026-05-21 21:37:25 +03:00
ew8bak 3bf8c1c162 Extract main status bar component 2026-05-21 21:27:43 +03:00
ew8bakandClaude Sonnet 4.6 36fa914e2f Increase TX web mic stall threshold to 6 ticks (~64ms)
Gives 44ms jitter margin for WiFi connections. Sound card mic path
is unaffected — StallCount never increments when FOnPullMic fills
the ring every tick.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:33:21 +03:00
ew8bakandClaude Sonnet 4.6 65545982e3 Fix TX mic hoarseness: pre-roll flush bug and wider stall margin
Pre-roll bug: when MIC_PREROLL_SAMP is an exact multiple of OPUS_FRAME_SAMP
(1920/960=2), the N<=Want branch filled the buffer but never flushed it,
losing the first 40ms of audio and leaving the ring empty long enough for
silence blocks to be injected into WDSP.

StallCount threshold raised from 2 to 4 (~43ms) to cover OS scheduler
jitter of up to 22ms, preventing false silence injection when an Opus
frame arrives slightly late relative to the DSP tick.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 20:30:14 +03:00
ew8bakandClaude Sonnet 4.6 ebca3b4137 Fix TX mic DUC starvation: add 512-sample staging buffer
Opus decodes 960 samples per frame; the TX DSP thread consumes
512-sample blocks. 960 mod 512 = 448, so the ring always kept a
sub-threshold tail, causing TTXDSPThread to skip ticks and starve
the DUC hardware every ~20 ms.

FlushMicToCallback accumulates samples in FMicStageBuf and calls
FOnWebMic only when a full 512-sample block is ready. The remainder
stays in the buffer until the next Opus frame arrives. This ensures
FTXMicRing always receives data in multiples of 512, eliminating
the 0 < Avail < 512 dead-zone entirely.

FMicStageLen is reset together with FMicPreRollPos on new TX session
to prevent stale samples from a previous session mixing in.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 18:51:21 +03:00
ew8bakandClaude Sonnet 4.6 cd9e504e8f Optimize web audio mic path: remove redundant copy and heap alloc
WebOnMic: drop intermediate Singles[] array, read PSingle directly.
PushAudio: replace per-frame SetLength/array of Byte with pre-allocated
FWsAudioBuf field — eliminates heap allocation from the DSP thread.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 18:31:48 +03:00
ew8bak 960cadd4b0 add alert ADC overload 2026-05-21 15:42:59 +03:00
ew8bak b5103bf474 add alert overlay 2026-05-21 15:38:56 +03:00
ew8bak 5800e9ec35 Improve radio status bar 2026-05-21 15:19:43 +03:00
ew8bak 343735389e Polish device dialog layout 2026-05-21 14:23:08 +03:00
ew8bak a0019493b6 Add compact web layout for medium screens 2026-05-20 20:56:33 +03:00
ew8bak 1b39bc6746 Improve settings layout and TX equalizer 2026-05-20 14:35:53 +03:00
ew8bak ad02fa3f77 fix .gitignore 2026-05-20 10:01:41 +03:00