zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 487fe77a16b1985cb4681d7607ec25033888f06f
parent 1f7bb497cafeecebcadedb7723f8aab3e36a6b8d
Author: Ricard Wanderlof <polluxsynth@butoba.net>
Date:   Wed,  9 Feb 2022 23:40:52 +0100

Bank.cpp: Update database after write (#331)

When writing a patch to a bank slot, rescan the database to keep
it updated. Otherwise, a subsequent search() call will not reflect
the current state of the banks, and consequently switching to Read
mode in the UI after writing to a slot in Write mode causes the old
bank contents to be displayed, and also causes any attempt to
load the recently saved patch to fail, as the corresponding patch
file no longer exists.

Diffstat:
Msrc/Misc/Bank.cpp | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/Misc/Bank.cpp b/src/Misc/Bank.cpp @@ -200,6 +200,9 @@ int Bank::savetoslot(unsigned int ninstrument, Part *part) return err; addtobank(ninstrument, legalizeFilename(tmpfilename) + ".xiz", (char *) part->Pname); + //Since we've changed the contents of one of the banks, rescan the + //database to keep it updated. + db->scanBanks(); return 0; }