fx_reclaim: use GetCurrentProjectInLoadSave for the save hook, stop disarming ReleaseFlush on one write, validate project before cached-track lookup

This commit is contained in:
2026-08-06 22:52:57 -04:00
parent 02790f1270
commit c95203718a
5 changed files with 91 additions and 33 deletions
+9 -3
View File
@@ -31,6 +31,9 @@
#include "core/version/app_version.h"
#include "core/view/view_mode_model.h"
// Forward-declared to keep this header SDK-free; the .cpp includes the real SDK header.
class ReaProject;
namespace reasampler {
// Owns the session's BankBook (pool + named banks) and drives persistence
@@ -147,9 +150,12 @@ public:
// The same write with the dirty mark OMITTED, for a caller already inside REAPER's
// own project save: marking dirty there would leave the project modified the instant
// it was saved, which is the whole reason that caller exists (fx_reclaim's
// ReleaseFlush). Not a general-purpose sibling — a mutation site that skips the dirty
// mark silently loses its write when the user closes without saving.
bool flushViewState();
// ReleaseFlush). `project` is the SAVING project the caller resolved (e.g. via
// GetCurrentProjectInLoadSave()) — this call trusts it rather than re-deriving the
// active tab, which is exactly the mismatch fx_reclaim's caller exists to avoid. Not
// a general-purpose sibling — a mutation site that skips the dirty mark silently
// loses its write when the user closes without saving.
bool flushViewState(ReaProject* project);
// Report-only prune dry-run: feeds the pure core with (present, referenced,
// owned) — `present` from the folder enumeration, the other two from the