Merge dev into phase-b-multibank (integrate parallel M7/8 + Phase D work before dev promotion)
# Conflicts: # CLAUDE.md # CMakeLists.txt # src/actions.cpp # src/bank_panel.cpp # src/persist.h
This commit is contained in:
@@ -198,6 +198,13 @@ void ReaSamplerSession::saveToActiveProject() {
|
||||
SetProjExtState(static_cast<ReaProject*>(proj), kProjExtNamespace,
|
||||
kProjExtViewKey, viewJson.c_str());
|
||||
|
||||
// Additive: the docked panel's tail setting rides alongside in its own key, so the
|
||||
// tail choice travels inside the .rpp. Independent write — does not disturb the
|
||||
// bank_index or view_state above.
|
||||
const std::string tailJson = serializeTailSetting(tail_);
|
||||
SetProjExtState(static_cast<ReaProject*>(proj), kProjExtNamespace,
|
||||
kProjExtTailKey, tailJson.c_str());
|
||||
|
||||
MarkProjectDirty(static_cast<ReaProject*>(proj));
|
||||
}
|
||||
|
||||
@@ -222,6 +229,23 @@ ViewModeModel loadViewModel(ReaProject* proj) {
|
||||
return std::move(*loaded);
|
||||
}
|
||||
|
||||
// Load the tail setting from a project's tail_setting key, or return the default. An
|
||||
// absent/empty key (older / never-adjusted project) yields the default setting (None /
|
||||
// 2 s manual) — graceful, never a crash. Malformed JSON is warned and also falls back
|
||||
// to default, mirroring the bank's and view's malformed handling.
|
||||
TailSetting loadTailSetting(ReaProject* proj) {
|
||||
if (!proj) return TailSetting{};
|
||||
const std::string tailJson =
|
||||
getProjExtStateString(proj, kProjExtNamespace, kProjExtTailKey);
|
||||
if (tailJson.empty()) return TailSetting{}; // no stored setting -> default
|
||||
std::optional<TailSetting> loaded = deserializeTailSetting(tailJson);
|
||||
if (!loaded) {
|
||||
ShowConsoleMsg("ReaSampler: stored tail setting is malformed — ignoring.\n");
|
||||
return TailSetting{};
|
||||
}
|
||||
return *loaded;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void ReaSamplerSession::loadFromProject(void* proj, const std::string& projectDir) {
|
||||
@@ -239,6 +263,11 @@ void ReaSamplerSession::loadFromProject(void* proj, const std::string& projectDi
|
||||
// only — no visibility/processing is applied here (that is D4).
|
||||
view_ = loadViewModel(static_cast<ReaProject*>(proj));
|
||||
|
||||
// The tail setting is restored on EVERY load path too (peer-symmetry): switching
|
||||
// to a project with no stored setting must fall back to the default, not inherit
|
||||
// the previous project's choice (this REPLACES the old session-carry behavior).
|
||||
tail_ = loadTailSetting(static_cast<ReaProject*>(proj));
|
||||
|
||||
if (!proj) {
|
||||
book_ = BankBook{};
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user