Skip to content

Commit

Permalink
FX Presets Streaming Revision triggers handleStreamingMismatches
Browse files Browse the repository at this point in the history
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 surge-synthesizer#5197
  • Loading branch information
baconpaul committed Oct 5, 2021
1 parent 74182de commit b119b25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/common/FxPresetAndClipboardManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/common/FxPresetAndClipboardManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit b119b25

Please sign in to comment.