gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 1ada7e779040f27c8d4a141871ed90131269441c
parent 4e6cd6dc59719b5326ebe79a69e091cae381f3fb
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun,  5 May 2024 16:12:43 +0200

always add user bank entries, not only if no other save entry added yet

Diffstat:
Msource/jucePluginEditorLib/patchmanager/patchmanager.cpp | 49+++++++++++++++++++++++--------------------------
1 file changed, 23 insertions(+), 26 deletions(-)

diff --git a/source/jucePluginEditorLib/patchmanager/patchmanager.cpp b/source/jucePluginEditorLib/patchmanager/patchmanager.cpp @@ -356,38 +356,35 @@ namespace jucePluginEditorLib::patchManager createSaveToUserBankEntry(ds); } - if(!countAdded) - { - const auto existingLocalDS = getDataSourcesOfSourceType(pluginLib::patchDB::SourceType::LocalStorage); + const auto existingLocalDS = getDataSourcesOfSourceType(pluginLib::patchDB::SourceType::LocalStorage); - if(!existingLocalDS.empty()) - { - for (const auto& ds : existingLocalDS) - createSaveToUserBankEntry(ds); - } - else + if(!existingLocalDS.empty()) + { + for (const auto& ds : existingLocalDS) + createSaveToUserBankEntry(ds); + } + else + { + ++countAdded; + _menu.addItem("Create new user bank and add patch", true, false, [this, _part] { - ++countAdded; - _menu.addItem("Create new user bank and add patch", true, false, [this, _part] - { - const auto newPatch = requestPatchForPart(_part); + const auto newPatch = requestPatchForPart(_part); - if(!newPatch) - return; + if(!newPatch) + return; - pluginLib::patchDB::DataSource ds; + pluginLib::patchDB::DataSource ds; - ds.name = "User Bank"; - ds.type = pluginLib::patchDB::SourceType::LocalStorage; - ds.origin = pluginLib::patchDB::DataSourceOrigin::Manual; - ds.timestamp = std::chrono::system_clock::now(); - addDataSource(ds, false, [newPatch, _part, this](const bool _success, const std::shared_ptr<pluginLib::patchDB::DataSourceNode>& _ds) - { - if(_success) - copyPatchesToLocalStorage(_ds, {newPatch}, static_cast<int>(_part)); - }); + ds.name = "User Bank"; + ds.type = pluginLib::patchDB::SourceType::LocalStorage; + ds.origin = pluginLib::patchDB::DataSourceOrigin::Manual; + ds.timestamp = std::chrono::system_clock::now(); + addDataSource(ds, false, [newPatch, _part, this](const bool _success, const std::shared_ptr<pluginLib::patchDB::DataSourceNode>& _ds) + { + if(_success) + copyPatchesToLocalStorage(_ds, {newPatch}, static_cast<int>(_part)); }); - } + }); } return countAdded;