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 18c855178e099b567efb26000a43843f86ccdb33
parent 77f5f140f5dcab229258f82a535f8ddfbbf5943b
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sat,  4 May 2024 14:03:32 +0200

add helper func to check if there is any added tag

Diffstat:
Msource/jucePluginLib/patchdb/tags.cpp | 10++++++++++
Msource/jucePluginLib/patchdb/tags.h | 6++++++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/source/jucePluginLib/patchdb/tags.cpp b/source/jucePluginLib/patchdb/tags.cpp @@ -109,6 +109,16 @@ namespace pluginLib::patchDB return it->second.addRemoved(_tag); } + bool TypedTags::containsAdded() const + { + for (const auto& it : m_tags) + { + if(it.second.containsAdded()) + return true; + } + return false; + } + bool TypedTags::erase(const TagType _type, const Tag& _tag) { const auto it = m_tags.find(_type); diff --git a/source/jucePluginLib/patchdb/tags.h b/source/jucePluginLib/patchdb/tags.h @@ -57,6 +57,11 @@ namespace pluginLib::patchDB const auto& getAdded() const { return m_added; } const auto& getRemoved() const { return m_removed; } + bool containsAdded() const + { + return !m_added.empty(); + } + bool containsAdded(const Tag& _tag) const { return m_added.find(_tag) != m_added.end(); @@ -91,6 +96,7 @@ namespace pluginLib::patchDB bool add(const TypedTags& _tags); bool erase(TagType _type, const Tag& _tag); bool addRemoved(TagType _type, const Tag& _tag); + bool containsAdded() const; bool containsAdded(TagType _type, const Tag& _tag) const; bool containsRemoved(TagType _type, const Tag& _tag) const; void clear();