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:
@@ -212,12 +212,12 @@ bool ReaSamplerSession::saveViewStateOnly() {
|
||||
}
|
||||
|
||||
// Its twin bar the dirty mark — the one line that differs is the whole point of the
|
||||
// split, so the two stay spelled out rather than folded behind a flag.
|
||||
bool ReaSamplerSession::flushViewState() {
|
||||
ReaProject* proj = activeSavedProject();
|
||||
if (!proj) return false;
|
||||
// split, so the two stay spelled out rather than folded behind a flag. `project` is
|
||||
// trusted as given rather than resolved via activeSavedProject() — see session.h.
|
||||
bool ReaSamplerSession::flushViewState(ReaProject* project) {
|
||||
if (!project) return false;
|
||||
|
||||
writeViewState(proj, view_);
|
||||
writeViewState(project, view_);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user