diff --git a/src/persist.cpp b/src/persist.cpp index 1d6c793..5016b14 100644 --- a/src/persist.cpp +++ b/src/persist.cpp @@ -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(proj), kProjExtNamespace, kProjExtIndexKey, json.c_str()); + MarkProjectDirty(static_cast(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(proj), kProjExtNamespace, kProjExtGuidKey, fresh.c_str()); + MarkProjectDirty(static_cast(proj)); } lastGuid_ = fresh; lastRppPath_ = rppPath;