Extract elapsedAtLeast to core/util, dedupe the throttle rationale, and correct the alloc-count/PLAN citations

This commit is contained in:
2026-08-03 14:58:33 -04:00
parent 170b2e4994
commit 32c7e959ae
7 changed files with 129 additions and 24 deletions
+10 -4
View File
@@ -47,6 +47,7 @@
#include "core/ui/tab_strip.h"
#include "core/ui/theme.h"
#include "core/ui/tooltip.h"
#include "core/util/elapsed_at_least.h"
#include "core/version/app_version.h"
#include "core/view/guid_diff.h"
#include "core/view/lane_keys.h"
@@ -182,6 +183,9 @@ using version::channelCommandId;
using version::dockIdent;
using version::dockTitle;
// core/util
using util::elapsedAtLeast;
// core/wire
using wire::buildInstrumentDropPreset;
@@ -208,9 +212,8 @@ 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.
// background poll nothing visible depends on. The throttle's correctness argument lives at
// detectNewContent's own comment (panel_input.cpp) — the authoritative home; not restated here.
inline constexpr unsigned int kDetectIntervalMs = 500;
// Client area top to bottom: top toolbar | split body | bottom toolbar | footer.
@@ -362,7 +365,10 @@ struct PanelState {
// 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.
// post-capture/ingest/bake call sites); the gate's correctness argument lives at
// detectNewContent (panel_input.cpp), not restated here. 0 forces the very first tick
// through PROVIDED system uptime is already >= kDetectIntervalMs at that call — always
// true in practice, but an assumption elapsedAtLeast takes, not one it guarantees.
unsigned int lastDetectTick = 0;
};