From 0dbae2c79ccb98f38b23d42ee8f0a94b3f834fb7 Mon Sep 17 00:00:00 2001 From: Frederik Bertling Date: Sun, 23 Jun 2024 21:24:16 +0200 Subject: [PATCH 1/2] fix(data): Now only saving data in the projects .rpp file, when there is at least one preset. --- liblpe/LivePresetsExtension.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/liblpe/LivePresetsExtension.cpp b/liblpe/LivePresetsExtension.cpp index 231b750..a6419bd 100644 --- a/liblpe/LivePresetsExtension.cpp +++ b/liblpe/LivePresetsExtension.cpp @@ -412,6 +412,10 @@ bool LPE::recallState(ProjectStateContext* ctx, bool) { void LPE::saveState(ProjectStateContext* ctx, bool) { auto *proj = GetCurrentProjectInLoadSave(); + // only save data when there are presets + if (mModels[proj].mPresets.empty()) + return + WDL_FastString chunk; mModels[proj].persist(chunk); @@ -431,4 +435,4 @@ void LPE::resetState(bool) { //cleaning data from ui mController.reset(); ControlViewController_Reset(&mControlView); -} \ No newline at end of file +} From 953a5338194b0f73c3a862f011f9c6057ea7351c Mon Sep 17 00:00:00 2001 From: Frederik Bertling Date: Sun, 23 Jun 2024 21:31:30 +0200 Subject: [PATCH 2/2] Fix --- liblpe/LivePresetsExtension.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblpe/LivePresetsExtension.cpp b/liblpe/LivePresetsExtension.cpp index a6419bd..063b10a 100644 --- a/liblpe/LivePresetsExtension.cpp +++ b/liblpe/LivePresetsExtension.cpp @@ -414,7 +414,7 @@ void LPE::saveState(ProjectStateContext* ctx, bool) { // only save data when there are presets if (mModels[proj].mPresets.empty()) - return + return; WDL_FastString chunk; mModels[proj].persist(chunk);