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 74d4f9751cd5c1b1950d4e6a1cb32ce9601a378f
parent d247f6bb629a37a0c7219d64c0e771661a5db7f7
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Mon, 20 May 2024 14:25:43 +0200

fix now outdated isInterestedInPatchList() with indices array, fixes not being able to D&D to user banks anymore

Diffstat:
Msource/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp | 2+-
Msource/jucePluginEditorLib/patchmanager/datasourcetreeitem.h | 5+++--
Msource/jucePluginEditorLib/patchmanager/grouptreeitem.cpp | 4++--
Msource/jucePluginEditorLib/patchmanager/grouptreeitem.h | 2+-
Msource/jucePluginEditorLib/patchmanager/tagtreeitem.cpp | 2+-
Msource/jucePluginEditorLib/patchmanager/tagtreeitem.h | 2+-
Msource/jucePluginEditorLib/patchmanager/treeitem.cpp | 20++------------------
Msource/jucePluginEditorLib/patchmanager/treeitem.h | 6++++--
8 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp b/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.cpp @@ -64,7 +64,7 @@ namespace jucePluginEditorLib::patchManager search(std::move(sr)); } - bool DatasourceTreeItem::isInterestedInSavePatchDesc(const SavePatchDesc& _desc) + bool DatasourceTreeItem::isInterestedInPatchList(const List* _list, const std::vector<pluginLib::patchDB::PatchPtr>& _patches) { return m_dataSource->type == pluginLib::patchDB::SourceType::LocalStorage; } diff --git a/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.h b/source/jucePluginEditorLib/patchmanager/datasourcetreeitem.h @@ -19,8 +19,9 @@ namespace jucePluginEditorLib::patchManager return m_dataSource->type == pluginLib::patchDB::SourceType::Folder; } - bool isInterestedInSavePatchDesc(const SavePatchDesc& _desc) override; - bool isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) override; + bool isInterestedInPatchList(const List* _list, const std::vector<pluginLib::patchDB::PatchPtr>& _patches) override; + + bool isInterestedInFileDrag(const juce::StringArray& files) override; void patchesDropped(const std::vector<pluginLib::patchDB::PatchPtr>& _patches, const SavePatchDesc* _savePatchDesc = nullptr) override; diff --git a/source/jucePluginEditorLib/patchmanager/grouptreeitem.cpp b/source/jucePluginEditorLib/patchmanager/grouptreeitem.cpp @@ -283,11 +283,11 @@ namespace jucePluginEditorLib::patchManager } } - bool GroupTreeItem::isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) + bool GroupTreeItem::isInterestedInPatchList(const List* _list, const std::vector<pluginLib::patchDB::PatchPtr>& _patches) { if(m_type == GroupType::Favourites) return true; - return TreeItem::isInterestedInPatchList(_list, _indices); + return TreeItem::isInterestedInPatchList(_list, _patches); } void GroupTreeItem::patchesDropped(const std::vector<pluginLib::patchDB::PatchPtr>& _patches, const SavePatchDesc* _savePatchDesc) diff --git a/source/jucePluginEditorLib/patchmanager/grouptreeitem.h b/source/jucePluginEditorLib/patchmanager/grouptreeitem.h @@ -44,7 +44,7 @@ namespace jucePluginEditorLib::patchManager void setParentSearchRequest(const pluginLib::patchDB::SearchRequest& _parentSearch) override; void onParentSearchChanged(const pluginLib::patchDB::SearchRequest& _parentSearchRequest) override; - bool isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) override; + bool isInterestedInPatchList(const List* _list, const std::vector<pluginLib::patchDB::PatchPtr>& _patches) override; void patchesDropped(const std::vector<pluginLib::patchDB::PatchPtr>& _patches, const SavePatchDesc* _savePatchDesc) override; private: diff --git a/source/jucePluginEditorLib/patchmanager/tagtreeitem.cpp b/source/jucePluginEditorLib/patchmanager/tagtreeitem.cpp @@ -26,7 +26,7 @@ namespace jucePluginEditorLib::patchManager return TreeItem::isInterestedInDragSource(dragSourceDetails) && hasSearch(); } - bool TagTreeItem::isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) + bool TagTreeItem::isInterestedInPatchList(const List*, const std::vector<pluginLib::patchDB::PatchPtr>&) { return hasSearch() && toTagType(getGroupType()) != pluginLib::patchDB::TagType::Invalid; } diff --git a/source/jucePluginEditorLib/patchmanager/tagtreeitem.h b/source/jucePluginEditorLib/patchmanager/tagtreeitem.h @@ -18,7 +18,7 @@ namespace jucePluginEditorLib::patchManager auto getGroupType() const { return m_group; } bool isInterestedInDragSource(const juce::DragAndDropTarget::SourceDetails& dragSourceDetails) override; - bool isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) override; + bool isInterestedInPatchList(const List* _list, const std::vector<pluginLib::patchDB::PatchPtr>& _indices) override; void patchesDropped(const std::vector<pluginLib::patchDB::PatchPtr>& _patches, const SavePatchDesc* _savePatchDesc = nullptr) override; void onParentSearchChanged(const pluginLib::patchDB::SearchRequest& _parentSearchRequest) override; diff --git a/source/jucePluginEditorLib/patchmanager/treeitem.cpp b/source/jucePluginEditorLib/patchmanager/treeitem.cpp @@ -146,25 +146,9 @@ namespace jucePluginEditorLib::patchManager { const auto* list = dynamic_cast<List*>(_dragSourceDetails.sourceComponent.get()); - if (list) - { - const auto* arr = _dragSourceDetails.description.getArray(); - if (!arr || arr->isEmpty()) - return false; - - for (const auto& var : *arr) - { - if (!var.isInt()) - return false; - } - - return isInterestedInPatchList(list, *arr); - } - - if(const auto* desc = SavePatchDesc::fromDragSource(_dragSourceDetails)) - return isInterestedInSavePatchDesc(*desc); + const auto& patches = SavePatchDesc::getPatchesFromDragSource(_dragSourceDetails); - return false; + return isInterestedInPatchList(list, patches); } void TreeItem::search(pluginLib::patchDB::SearchRequest&& _request) diff --git a/source/jucePluginEditorLib/patchmanager/treeitem.h b/source/jucePluginEditorLib/patchmanager/treeitem.h @@ -59,8 +59,10 @@ namespace jucePluginEditorLib::patchManager bool isInterestedInDragSource(const juce::DragAndDropTarget::SourceDetails& _dragSourceDetails) override; - virtual bool isInterestedInPatchList(const List* _list, const juce::Array<juce::var>& _indices) { return false; } - virtual bool isInterestedInSavePatchDesc(const SavePatchDesc& _desc) { return false; } + virtual bool isInterestedInPatchList(const List* _sourceList, const std::vector<pluginLib::patchDB::PatchPtr>& _patches) { return false; } + + bool isInterestedInFileDrag(const juce::StringArray& _files) override; + void filesDropped(const juce::StringArray& _files, int _insertIndex) override; virtual int compareElements(const TreeViewItem* _a, const TreeViewItem* _b);