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 08e24e47aa8454a004c9787e83231150e3c17bc5
parent 8f2bbd51eeee1a3a50ad3d38ef18077431dde8ea
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Mon, 20 May 2024 14:33:58 +0200

missing file

Diffstat:
Msource/jucePluginEditorLib/patchmanager/patchmanager.cpp | 39++++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/source/jucePluginEditorLib/patchmanager/patchmanager.cpp b/source/jucePluginEditorLib/patchmanager/patchmanager.cpp @@ -593,16 +593,12 @@ namespace jucePluginEditorLib::patchManager if(_part >= m_state.getPartCount()) return false; - pluginLib::patchDB::DataList results; - loadFile(results, _filename); + const auto patches = loadPatchesFromFiles(std::vector<std::string>{_filename}); - if(results.empty()) + if(patches.empty()) return false; - auto result = results.front(); - const auto patch = initializePatch(std::move(result)); - if(!patch) - return false; + const auto& patch = patches.front(); if(!activatePatch(patch, _part)) return false; @@ -613,6 +609,35 @@ namespace jucePluginEditorLib::patchManager return true; } + std::vector<pluginLib::patchDB::PatchPtr> PatchManager::loadPatchesFromFiles(const juce::StringArray& _files) + { + std::vector<std::string> files; + + for (const auto& file : _files) + files.push_back(file.toStdString()); + + return loadPatchesFromFiles(files); + } + + std::vector<pluginLib::patchDB::PatchPtr> PatchManager::loadPatchesFromFiles(const std::vector<std::string>& _files) + { + std::vector<pluginLib::patchDB::PatchPtr> patches; + + for (const auto& file : _files) + { + pluginLib::patchDB::DataList results; + if(!loadFile(results, file) || results.empty()) + continue; + + for (auto& result : results) + { + if(const auto patch = initializePatch(std::move(result))) + patches.push_back(patch); + } + } + return patches; + } + void PatchManager::onLoadFinished() { DB::onLoadFinished();