Throttle new-content enumeration to 500ms, off the 30/s OnTimer tick

This commit is contained in:
2026-08-03 14:40:50 -04:00
parent 93d6fd0271
commit 170b2e4994
2 changed files with 37 additions and 13 deletions
+17 -4
View File
@@ -206,6 +206,13 @@ inline constexpr unsigned int kTooltipDelayMs = 500;
inline constexpr int kTooltipCharPx = 7;
inline constexpr int kTooltipTextH = 14;
// New-content detection's enumeration cadence — matches the VST3 side's own
// kSyncTimerIntervalMs (editor_platform.cpp), this codebase's established interval for a
// background poll nothing visible depends on. Auto-tag is an invisible metadata update
// (see detectNewContent), so a 15x cadence cut (30/s -> 2/s) costs latency no one watches
// for, not correctness.
inline constexpr unsigned int kDetectIntervalMs = 500;
// Client area top to bottom: top toolbar | split body | bottom toolbar | footer.
// 26, not 24: Font::RegionTitle's line box (19px em + Segoe UI's leading) is ~25px, and
// DT_VCENTER clips to the rect.
@@ -345,12 +352,18 @@ struct PanelState {
bool previewActive = false;
bool previewInited = false; // guards double init / deinit
// Each timer tick diffs the live track+item GUID set against the previous tick to
// auto-tag new content. GuidBaseline self-arms on first observe() so pre-existing
// content is never mass-tagged. Project-load re-arm is driven by persist's load
// signal, not a ReaProject* compare — a recycled address previously mis-tagged tracks.
// Each enumerating tick (kDetectIntervalMs-throttled) diffs the live track+item GUID
// set against the prior enumeration to auto-tag new content. GuidBaseline self-arms on
// first observe() so pre-existing content is never mass-tagged. Project-load re-arm is
// driven by persist's load signal, not a ReaProject* compare — a recycled address
// previously mis-tagged tracks.
GuidBaseline contentBaseline;
bool reloadPending = false; // set by bankPanelNotifyProjectLoaded; drained next detect tick
// Throttles enumerateLiveGuids to kDetectIntervalMs regardless of how often
// bankPanelRefresh itself is called (the OnTimer poll, ~30/s, plus a handful of
// post-capture/ingest/bake call sites). 0 forces the very first tick through.
unsigned int lastDetectTick = 0;
};
// Defined in panel_window.cpp (the lifecycle owner).