11namespace tracktion {
inline namespace engine
24 bool isValid()
const noexcept {
return itemID != 0; }
25 bool isInvalid()
const noexcept {
return itemID == 0; }
44 operator juce::var()
const {
return toVar(); }
48 uint64_t getRawID()
const noexcept {
return itemID; }
51 bool operator== (
EditItemID other)
const noexcept {
return itemID == other.itemID; }
52 bool operator!= (
EditItemID other)
const noexcept {
return itemID != other.itemID; }
53 bool operator< (
EditItemID other)
const noexcept {
return itemID < other.itemID; }
107template<
typename EditItemType>
115 auto o = knownEditItems.find (
id);
117 if (o != knownEditItems.cend())
123 template<
typename Visitor>
124 void visitItems (Visitor&& visitor)
const
126 for (
auto iter : knownEditItems)
130 void addItem (EditItemType& item)
132 jassert (knownEditItems.find (item.itemID) == knownEditItems.end());
134 if (item.itemID.isValid())
135 knownEditItems[item.itemID] = &item;
138 void removeItem (EditItemType& item)
140 if (item.itemID.isValid())
141 knownEditItems.erase (item.itemID);
155 struct VariantConverter<
tracktion::engine::EditItemID>
Base class for objects that live inside an edit - e.g.
const EditItemID itemID
Every EditItem has an ID which is unique within the edit.
The Tracktion Edit class!
size_t hash(size_t seed, const T &v)
Hashes a type with a given seed and returns the new hash value.
ID for objects of type EditElement - e.g.
static std::function< void(juce::ValueTree &, const juce::Identifier &, const std::map< juce::String, EditItemID > &, juce::UndoManager *)> applyNewIDsToExternalValueTree
Callback that can be set in order to update any reassigned IDs in ValueTree client code.
static std::function< void(juce::XmlElement &, const juce::String &, const std::map< juce::String, EditItemID > &)> applyNewIDsToExternalXML
Callback that can be set in order to update any reassigned IDs in XML client code.