Skip to content

Commit

Permalink
Update patchid and category state on save (#5592)
Browse files Browse the repository at this point in the history
When saving a patch to a new file, the patch id and current
category isn't updated so you get, well, the old one mostly!
Fix that by rescanning after a save.

Closes #5570
  • Loading branch information
baconpaul authored Dec 7, 2021
1 parent bb4998d commit 8fa1338
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/common/SurgeSynthesizerIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,17 @@ void SurgeSynthesizer::savePatchToPath(fs::path filename)
// refresh list
storage.refresh_patchlist();
storage.initializePatchDb(true);

int idx = 0;
for (auto p : storage.patch_list)
{
if (p.path == filename)
{
patchid = idx;
current_category_id = p.category;
}
idx++;
}
refresh_editor = true;
midiprogramshavechanged = true;
}
Expand Down

0 comments on commit 8fa1338

Please sign in to comment.