Commit Graph
165 Commits
Author SHA1 Message Date
ew8bak 474a638abc add portaudio dll inno setup 2026-06-02 15:58:35 +03:00
ew8bakandClaude Sonnet 4.6 710abce288 use %APPDATA%\ewsdr on Windows instead of exe directory
Program Files is read-only for normal users; GetAppConfigDir(False)
returns the proper per-user config location on all platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 15:52:11 +03:00
ew8bak 3e1988c00e add opengl parameter innosetup 2026-06-02 15:05:13 +03:00
ew8bak 88a0dd9b80 fix version ewsdr.lpi 2026-06-02 14:34:23 +03:00
ew8bak 827c6b3207 add libfftw in ewsdr_inno_setup 2026-06-02 14:29:23 +03:00
ew8bak 1bb831d7b1 add other folder 2026-06-02 14:26:42 +03:00
ew8bak d8584323ac Revert "Add WFM (broadcast FM) demodulator support"
This reverts commit e52e32dc20.
2026-06-01 14:40:39 +03:00
ew8bakandClaude Opus 4.7 e52e32dc20 Add WFM (broadcast FM) demodulator support
Wires the new wdsp WFM API into the engine and adds a WFM preset to the
FM filter row (200 kHz BW / 75 kHz deviation). Also fixes WDSP_SAM
constant which was 12 — that slot is now RXA_WFM in the updated enum.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 22:40:24 +03:00
ew8bakandClaude Sonnet 4.6 83ec28f997 Prevent OS sleep and display blanking while SDR is running
Add PowerInhibit.pas with InhibitSleep/UninhibitSleep:
- Windows: SetThreadExecutionState (kernel32, no child process)
- macOS: caffeinate -d -i -s -w <PID> (auto-exits on crash via -w flag)
- Linux: systemd-inhibit with kill-0 poll loop (releases within 5s on crash)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 21:33:30 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 655d242d02 Add Spectrum gradient fill toggle in settings
Mirror the existing Wideband gradient fill option for the main spectrum:
a "Spectrum gradient fill" checkbox on the Display settings tab gates the
under-curve gradient in TSpectrumView.DrawSpectrum. The curve, grid,
filter band and VFO markers always draw; only the gradient is optional.

Persisted as spectrum_fill in settings JSON (default True, preserving
current appearance). Wired through Settings -> SettingsForm visibility
event -> MainForm -> TSpectrumView.FillSpectrum, same path as
WidebandFill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 15:24:33 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 2a7bf8528a Cache SampleRateOverlay to a bitmap instead of redrawing per frame
The span-selector panel was rendered directly onto the spectrum canvas
every frame via DrawSelf, doing ~30 TextWidth + ~11 TextOut Canvas calls.
On Cocoa these text ops are very expensive (~10.6 ms/frame, ~30% of a
core) and dominated DrawSpectrum.

Render the panel once into a per-pixel-alpha cache bitmap and only
composite it over the spectrum each frame; rebuild only when state
changes (rate, hover, hidden, bounds). The cache is built with the
two-background method (render over black and white, derive straight
alpha + color) so layered semi-transparent button fills and antialiased
text composite over the live spectrum exactly as before.

Cuts the overlay phase from ~10.6 ms to ~0.2 ms per frame; DrawSpectrum
drops ~13.8 ms -> ~2.7 ms. Mirrors the caching VfoOverlay already uses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 15:10:30 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 c3a8a14110 Drop per-frame alpha-restore pass on macOS spectrum
On Cocoa the full-bitmap alpha-restore pass is unnecessary: Canvas
operations keep alpha at $FF and the cached grid background is opaque,
so removing it cuts a full-frame O(W*H) pass per spectrum frame with no
visual change (verified on macOS).

Kept under {$IFNDEF DARWIN} for Qt6/win32 (different drawing backends
may zero alpha on antialiased edges) until visually verified there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 14:31:18 +03:00
Uladzimir KarpenkaandClaude Opus 4.8 55d5bf01cf Optimize CPU waterfall/spectrum rendering
WaterfallView: drop per-frame TLazIntfImage + LoadFromIntfImage (device
bitmap recreation + full pixel-format conversion every frame). Write
pixels directly into the bitmap via BeginUpdate/ScanLine like
SpectrumView already does, with platform-native byte order (ARGB on
Cocoa, BGRA elsewhere).

Replace per-pixel float colorization with a 512-entry dB->color LUT
rebuilt only when WfLow/WfHigh/theme change beyond a small threshold.

Turn the bitmap itself into a ring buffer: each frame builds a single
new row and writes one ScanLine; scrolling is done at paint time via two
CopyRect calls. Removes both full-frame passes per frame (image memmove
+ buffer->bitmap copy), cutting per-frame cost from O(W*H) to O(W). TX
mode preserved by leaving out-of-span columns untouched in the row buf.

SpectrumView: rewrite the per-frame alpha-restore pass from a strided
per-byte loop to a sequential per-dword OR with the alpha mask
(bit-identical output, sequential memory access).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 14:21:40 +03:00
Uladzimir Karpenka 16259ed704 add script create macOS bundle app 2026-05-29 08:00:22 +03:00
Uladzimir Karpenka 2ab02d7681 Store WDSP wisdom file in app config dir alongside settings JSON 2026-05-28 22:16:57 +03:00
Uladzimir Karpenka a02d35fcce Fix macOS pixel format: use ARGB byte order in all raw ScanLine blending
On macOS Cocoa, TBitmap.pf32bit stores pixels in ARGB order
   (byte0=A, byte1=R, byte2=G, byte3=B) rather than BGRA used on
   Linux/Windows. All raw ScanLine pixel blending and channel mapping
   is now guarded with { DARWIN} to use the correct offsets.

   Also fix PortAudio library discovery on macOS: probe .dylib names
   (including Homebrew paths) before falling through to .so/.dll.
2026-05-28 21:47:54 +03:00
Uladzimir Karpenka 4f127a30ad fix macOS build 2026-05-28 15:59:49 +03:00
ew8bakandClaude Sonnet 4.6 4f281ce400 Channel memory: apply and restore TX power, fix auto-clear after band switch
- ApplyChannel now sets TrkDrive from Ch.Power; saves pre-channel level in
  FPreChannelPower (works around TrkDriveChange clearing the field on assignment)
- Power is restored when tuning away from channel (CheckChannelActive) or on
  first VFO movement after returning to band with no active channel (ApplyVfoA)
- Manual drive slider move clears FPreChannelPower so restore is skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 15:52:54 +03:00
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