feat(view): D4 Design View action family + reapply-on-open wiring

Register toggle/activate/tag/untag/show-both actions driving the D2
shell and D3 model; reapply saved active mode on project load via a
persist load-signal seam. Shared guidString helper; pure nextModeId
unit-tested.
This commit is contained in:
2026-07-22 21:46:58 -04:00
parent 322581227c
commit ae41cad4f5
12 changed files with 418 additions and 16 deletions
+14
View File
@@ -207,6 +207,14 @@ ViewModeModel loadViewModel(ReaProject* proj) {
} // namespace
void ReaSamplerSession::loadFromProject(void* proj, const std::string& projectDir) {
// Raise the load signal for the D4 reapply-on-open glue. loadFromProject is the
// single choke point for every load path (prime, project switch/open, forked-
// sibling load), so setting it here — and NOT on the Save-As branch, which keeps
// the in-memory model as-is — makes the signal fire exactly when a fresh view
// model has been installed and its active mode's visibility needs reapplying.
// main.cpp drains it via consumeLoadSignal() on the same tick.
loadPending_ = true;
// The view model is restored on EVERY load path (peer-symmetry with the bank
// reset below): switching to a project with no view state must clear stale
// in-memory state, not inherit the previous project's. D3 restores MODEL STATE
@@ -264,6 +272,12 @@ std::string ensureProjectGuid(void* proj, const std::string& rppPath,
} // namespace
bool ReaSamplerSession::consumeLoadSignal() {
const bool pending = loadPending_;
loadPending_ = false;
return pending;
}
void ReaSamplerSession::poll() {
std::string rppPath;
void* proj = readActiveProject(rppPath);