Merge M4 fix: MarkProjectDirty so captures flush to the .rpp

This commit is contained in:
2026-07-22 20:15:37 -04:00
+5 -1
View File
@@ -54,6 +54,7 @@
#define REAPERAPI_MINIMAL
#define REAPERAPI_WANT_EnumProjects
#define REAPERAPI_WANT_GetProjExtState
#define REAPERAPI_WANT_MarkProjectDirty
#define REAPERAPI_WANT_SetProjExtState
#define REAPERAPI_WANT_ShowConsoleMsg
#define REAPERAPI_WANT_genGuid
@@ -162,6 +163,7 @@ void ReaSamplerSession::saveToActiveProject() {
const std::string json = bank_.serialize();
SetProjExtState(static_cast<ReaProject*>(proj), kProjExtNamespace,
kProjExtIndexKey, json.c_str());
MarkProjectDirty(static_cast<ReaProject*>(proj));
}
void ReaSamplerSession::loadFromProject(void* proj, const std::string& projectDir) {
@@ -266,11 +268,13 @@ void ReaSamplerSession::poll() {
// Save-As duplicated our ext state, so the new project B currently
// shares A's GUID. Mint a FRESH GUID for B and write it, so A and B
// no longer collide on identity when reopened later. Adopt the fresh
// GUID as our last-seen identity.
// GUID as our last-seen identity. Mark dirty so the fresh GUID flushes
// to the new .rpp on the next normal save / close-prompt.
const std::string fresh = genProjectGuidString();
if (proj) {
SetProjExtState(static_cast<ReaProject*>(proj), kProjExtNamespace,
kProjExtGuidKey, fresh.c_str());
MarkProjectDirty(static_cast<ReaProject*>(proj));
}
lastGuid_ = fresh;
lastRppPath_ = rppPath;