Q-W3 review follow-ups: golden hash literal test, CLAUDE.md wav_codec bullet, dead RecordedCapture field comment, makeUniqueTag residual note

This commit is contained in:
2026-07-29 11:28:55 -04:00
parent 09f7173db2
commit 8bc5aa1257
4 changed files with 36 additions and 2 deletions
+10
View File
@@ -114,6 +114,16 @@ struct RecordedCapture {
std::vector<std::string> trackGuids;
int channelCount = 0;
// TEST-ONLY / dead in production (Q-W3 review follow-up): the shell no longer
// populates these five fields before calling sampleFromRecordedCapture — the
// finalize path (capture_realtime_finalize.cpp) leaves them at their defaults
// and instead calls the shared stampCaptureSample(result.sample, ...) right
// after, which writes Sample::sampleRate/captureTempo/captureTimeSigNum/
// captureTimeSigDenom/createdTimestamp directly, overwriting whatever
// sampleFromRecordedCapture set from these. Kept (not deleted) because the pure
// unit tests still construct/assert them directly; removing the fields is a
// struct-shape decision out of scope here.
int sampleRate = 0; // 0 when the project rate was unknown (as offline)
double captureTempo = 0.0; // BPM at capture time (shell reads Master_GetTempo)
// Time signature at capture start (L7 F1; shell reads TimeMap_GetTimeSigAtTime).
+6
View File
@@ -239,6 +239,12 @@ std::string makeUniqueTag(const std::string& prefix) {
// session distinct regardless of timing. NOTE: the tag varies the file NAME,
// not the audio bytes — bit-identical-repeat is about identical *content* for
// identical requests; two deliberate captures naturally live in two files.
// RESIDUAL (Q-W3 review follow-up): the counter is per-process, starting over
// at 0 on every REAPER launch/extension reload, so two separate REAPER
// instances (or a reload mid-session) can still mint the same timestamp+counter
// pair in the same wall-clock second — a same-second cross-process collision
// remains theoretically possible. Scoped to per-session deliberately: this fix
// targets the reachable-in-practice single-process batch-capture case above.
static std::atomic<unsigned long long> counter{0};
const std::time_t now = std::time(nullptr);
return prefix + std::to_string(static_cast<long long>(now)) + "-" +