Split FX out of the park plan: flag-only plans, derived online-first FX work list, two-half record release, applied-state fingerprint

This commit is contained in:
2026-08-06 16:31:59 -04:00
parent 3eae942625
commit 2423225f0c
14 changed files with 897 additions and 164 deletions
+3 -1
View File
@@ -17,6 +17,7 @@
#include "shell/capture/item_read.h"
#include "core/view/fx_offline.h"
#include "core/view/fx_state.h"
#include "core/view/lane_keys.h"
#include "core/view/solo_cache.h"
#include "shell/capture/track_guid.h"
@@ -471,7 +472,8 @@ bool applyMode(ViewModeModel& model, const std::string& targetModeId, ReaProject
MediaTrack* tr = resolve(trackByGuid, guid);
if (!tr || !trackStillLive(project, tr)) continue; // stale/deleted GUID — prune
const TrackApplyResult r = restoreTrack(model, guid, tr, tp.fxOffline, tp.flags);
const std::vector<FxOfflineOp> fxOps = view::fxRestoreTargets(model, guid);
const TrackApplyResult r = restoreTrack(model, guid, tr, fxOps, tp.flags);
if (r.wrote) wrote = true;
if (r.fxMoved) undoMask |= UNDO_STATE_FX;
if (r.drops.total() > 0) { fxDrops.add(r.drops); ++fxDropTracks; }
+5 -3
View File
@@ -203,15 +203,17 @@ TrackApplyResult restoreTrack(ViewModeModel& model, const std::string& guid, Med
for (const FxOfflineWrite& w : res.writes)
if (setOfflineIfChanged(tr, w.fxIndex, w.offline)) out.fxMoved = out.wrote = true;
out.drops = res.drops;
// The chain is back online HERE, which is the only thing that spends the FX half.
model.releaseSnapshotFx(guid);
if (applyFlags(tr, flags, out.fxMoved)) out.wrote = true;
model.releaseSnapshotFlags(guid);
// Unconditional, even when every write above was elided: the snapshot is consumed
// Unconditional, even when every write above was elided: the record is consumed
// here, so this apply changed state and is not repeatable — and `wrote`, whose one
// reader asks exactly that, would be a lie at false. NOT a claim about what the
// undo record holds: the block never carries the snapshot either way, that being
// undo record holds: the block never carries the record either way, that being
// model state persisted after Undo_EndBlock2 (src/shell/view/CLAUDE.md).
model.clearSnapshot(guid);
out.wrote = true;
return out;
}