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

support dragging a whole data source to modify all patches inside

Diffstat:
Msource/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp | 14++++++++++++++
Msource/jucePluginEditorLib/patchmanager/datasourcetreeitem.h | 2++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp b/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp @@ -215,4 +215,18 @@ namespace jucePluginEditorLib::patchManager return ds->name; } } + + juce::var DatasourceTreeItem::getDragSourceDescription() + { + if(!m_dataSource || m_dataSource->patches.empty()) + return TreeItem::getDragSourceDescription(); + + uint32_t i=0; + std::map<uint32_t, pluginLib::patchDB::PatchPtr> patches; + + for (const auto& patch : m_dataSource->patches) + patches.insert({i++, patch}); + + return new SavePatchDesc(getPatchManager(), std::move(patches)); + } } diff --git a/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.h b/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.h @@ -35,6 +35,8 @@ namespace jucePluginEditorLib::patchManager const auto& getDataSource() const { return m_dataSource; } juce::String getTooltip() override; + + juce::var getDragSourceDescription() override; private: const pluginLib::patchDB::DataSourceNodePtr m_dataSource; };