From b119b25118d41d7325d95dac2207762410ae598a Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 5 Oct 2021 09:52:10 -0400 Subject: [PATCH] FX Presets Streaming Revision triggers handleStreamingMismatches In the past it was ignored, but now it gives the newly created FX the same swing at mismatches you get for a full patch. Closes #5197 --- src/common/FxPresetAndClipboardManager.cpp | 9 +++++++++ src/common/FxPresetAndClipboardManager.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/common/FxPresetAndClipboardManager.cpp b/src/common/FxPresetAndClipboardManager.cpp index 1e9f09f3b7f..645b2475dba 100644 --- a/src/common/FxPresetAndClipboardManager.cpp +++ b/src/common/FxPresetAndClipboardManager.cpp @@ -94,6 +94,13 @@ void FxUserPreset::doPresetRescan(SurgeStorage *storage, bool forceRescan) if (!r) goto badPreset; + preset.streamingVersion = ff_revision; + int sv; + if (r->QueryIntAttribute("streaming_version", &sv) == TIXML_SUCCESS) + { + preset.streamingVersion = sv; + } + auto s = TINYXML_SAFE_TO_ELEMENT(r->FirstChild("snapshot")); if (!s) @@ -321,6 +328,8 @@ void FxUserPreset::loadPresetOnto(const Preset &p, SurgeStorage *storage, FxStor { t_fx->init_ctrltypes(); t_fx->init_default_values(); + if (p.streamingVersion != ff_revision) + t_fx->handleStreamingMismatches(p.streamingVersion, ff_revision); delete t_fx; } diff --git a/src/common/FxPresetAndClipboardManager.h b/src/common/FxPresetAndClipboardManager.h index 706cb654bcd..dd28fa2f34e 100644 --- a/src/common/FxPresetAndClipboardManager.h +++ b/src/common/FxPresetAndClipboardManager.h @@ -32,6 +32,7 @@ struct FxUserPreset { std::string file; std::string name; + int streamingVersion{ff_revision}; fs::path subPath{}; bool isFactory{false}; int type{-1};