From 6fbd1185009c9d61dffb078fb782a3d42e967b0e Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" <247927+cjcliffe@users.noreply.github.com> Date: Fri, 24 Jul 2026 00:44:59 -0400 Subject: [PATCH] missed info check --- docs/RECOMMENDATIONS.md | 2 +- docs/design/README.md | 7 +++++++ docs/design/signal-flow.md | 2 +- docs/design/threading.md | 4 +++- docs/plans/resolve-todos.md | 4 ++-- docs/plans/split-appframe.md | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/RECOMMENDATIONS.md b/docs/RECOMMENDATIONS.md index 460caea..aacd2de 100644 --- a/docs/RECOMMENDATIONS.md +++ b/docs/RECOMMENDATIONS.md @@ -16,7 +16,7 @@ | Issue | Severity | |-------|----------| | **Zero test coverage** — no test framework, no test files, CI only builds | Critical | -| **Monolithic files** — `AppFrame.cpp` is ~2,700 lines | High | +| **Monolithic files** — `AppFrame.cpp` is ~3,200 lines | High | | **Memory safety** — raw `new`/`delete` for threads, `reinterpret_cast` type punning in DataTree, suppressed MSVC C4996 warnings | High | | **Outdated CMake** — targets 2.8.12, uses `-std=c++0x` draft flag, deprecated patterns | Medium | | **Incomplete .gitignore** — missing IDE, OS, and build artifact patterns | Medium | diff --git a/docs/design/README.md b/docs/design/README.md index 9a71cbd..29e4402 100644 --- a/docs/design/README.md +++ b/docs/design/README.md @@ -24,6 +24,8 @@ src/ process/ FFT and visual data processing util/ Core utilities (queues, timers, data trees) rig/ Hamlib CAT control (optional) + forms/ UI forms (device selection, bookmarks, dialogs) + panel/ Display panels (scope, spectrum, waterfall, meter) ``` ### Key Classes @@ -32,12 +34,17 @@ src/ |-------|------|------| | `CubicSDR` | `src/CubicSDR.h` | Application singleton, owns all global threads | | `AppFrame` | `src/AppFrame.h` | Main wxWidgets window, UI event loop | +| `AppConfig` | `src/AppConfig.h` | Application configuration persistence | | `SDRThread` | `src/sdr/SoapySDRThread.h` | Reads IQ samples from hardware | | `SDRPostThread` | `src/sdr/SDRPostThread.h` | Channelizes and distributes IQ data | +| `SDREnumerator` | `src/sdr/SDREnumerator.h` | Background device discovery | | `DemodulatorInstance` | `src/demod/DemodulatorInstance.h` | Orchestrates one demodulator's thread chain | | `DemodulatorMgr` | `src/demod/DemodulatorMgr.h` | Manages all demodulator instances | +| `DemodulatorWorkerThread` | `src/demod/DemodulatorWorkerThread.h` | Offloaded modem/filter creation | | `Modem` | `src/modules/modem/Modem.h` | Abstract modem base class with factory pattern | | `AudioThread` | `src/audio/AudioThread.h` | Manages RtAudio output device | +| `AudioSinkThread` | `src/audio/AudioSinkThread.h` | Per-demod audio sink (base class) | +| `AudioSinkFileThread` | `src/audio/AudioSinkFileThread.h` | WAV file recording | | `IOThread` | `src/IOThread.h` | Base class for all worker threads | | `ThreadBlockingQueue` | `src/util/ThreadBlockingQueue.h` | Primary inter-thread communication mechanism | diff --git a/docs/design/signal-flow.md b/docs/design/signal-flow.md index ae704fb..3857412 100644 --- a/docs/design/signal-flow.md +++ b/docs/design/signal-flow.md @@ -27,7 +27,7 @@ SDR Hardware (SoapySDR) [Stage 4] DemodulatorThread |---[pipeAudioData]---------> AudioThread (speaker output) |---[audioVisOutputQueue]---> ScopeVisualProcessor (scope display) - |---[audioSinkOutputQueue]--> AudioSinkThread (WAV recording) + |---[audioSinkOutputQueue]--> AudioSinkFileThread (WAV recording) v [Stage 5] AudioThread -> RtAudio hardware callback -> speakers/headphones ``` diff --git a/docs/design/threading.md b/docs/design/threading.md index b19009b..695fddc 100644 --- a/docs/design/threading.md +++ b/docs/design/threading.md @@ -41,7 +41,8 @@ On macOS, `DemodulatorPreThread` and `DemodulatorThread` use `pthread_create` wi | Demodulator Thread (N) | `DemodulatorThread` | `src/demod/DemodulatorThread.h` | Core demodulation, squelch, signal levels | | Audio Thread (N) | `AudioThread` | `src/audio/AudioThread.h` | Per-demod audio processing and device binding | | Audio Controller | `AudioThread` | `src/audio/AudioThread.h` | Per-device RtAudio stream owner and mixer | -| Audio Sink (N) | `AudioSinkThread` | `src/audio/AudioSinkThread.h` | WAV file recording | +| Audio Sink (N) | `AudioSinkThread` | `src/audio/AudioSinkThread.h` | Base audio sink for demodulator output | +| Audio Sink File (N) | `AudioSinkFileThread` | `src/audio/AudioSinkFileThread.h` | WAV file recording | | Rig Control (optional) | `RigThread` | `src/rig/RigThread.h` | Hamlib CAT control | ## Communication Patterns @@ -141,6 +142,7 @@ On macOS, threads are assigned scheduling priorities: | Demodulator Pre-Thread | `SCHED_FIFO` | max - 1 | | Demodulator Thread | `SCHED_FIFO` | max - 1 | | Audio Thread (controller) | `SCHED_RR` | max - 1 | +| Audio Sink Thread | `SCHED_RR` | max - 1 | Note: SDR Thread has `SCHED_FIFO` priority code but it is currently commented out. diff --git a/docs/plans/resolve-todos.md b/docs/plans/resolve-todos.md index 890c5fe..50e9d8b 100644 --- a/docs/plans/resolve-todos.md +++ b/docs/plans/resolve-todos.md @@ -18,8 +18,8 @@ Multiple TODO/FIXME markers in project source code: | `DemodulatorThread.cpp` | `TODO: handle digital modems with audio output` | Convert to GitHub issue | | `DemodulatorMgr.cpp` | `TODO: This is probably unnecessary and confusing` | Investigate and either fix or remove | | `SoapySDRThread.cpp` | Various TODOs about timing and bandwidth (x3) | Convert to GitHub issues | -| `GainCanvas.cpp` | `TODO: if not desirable, do not update in AGC mode` | Convert to GitHub issue | -| `ScopeCanvas.cpp` | `TODO: find out why frontbuffer drawing stopped in wx 3.1.0?` | Investigate; may be fixed in newer wxWidgets | +| `GainCanvas.cpp` | `TODO: if it not desirable, do not update in AGC mode` | Convert to GitHub issue | +| `ScopeCanvas.cpp` | `TODO: find out why frontbuffer drawing has stopped working in wx 3.1.0?` | Investigate; may be fixed in newer wxWidgets | | `PrimaryGLContext.cpp` | `TODO: Better recording indicator...` | Convert to GitHub issue | | `BookmarkView.cpp` | `TODO: keys for other actions?` | Convert to GitHub issue | diff --git a/docs/plans/split-appframe.md b/docs/plans/split-appframe.md index 8291010..7948cf3 100644 --- a/docs/plans/split-appframe.md +++ b/docs/plans/split-appframe.md @@ -4,7 +4,7 @@ See also: [RECOMMENDATIONS.md](../RECOMMENDATIONS.md) | [PLAN.md](../PLAN.md) | ## Current State -- `AppFrame.cpp`: ~2,700 lines in a single file +- `AppFrame.cpp`: ~3,200 lines in a single file - `AppFrame.h`: multiple hundreds of lines - Handles menus, keyboard, device management, UI layout, hamlib, sessions, idle handlers, and accessors