12namespace tracktion {
inline namespace engine
27 notifyListenersOfDeletion();
37 if (
auto existingClip =
getClip())
38 existingClip->removeFromParent();
42 auto um = c->getUndoManager();
43 c->state.getParent().removeChild (c->state, um);
55 return at->getClipSlotList().getClipSlots().
indexOf (
this);
63 for (
auto in :
track.edit.getAllInputDevices())
64 for (auto dest : in->destinations)
65 if (dest->targetID ==
state[IDs::id])
74 return TRANS(
"Clip Slot");
79 return TRANS(
"Clip Slot");
103void ClipSlot::clipCreated (
Clip&)
107void ClipSlot::clipAddedOrRemoved()
112void ClipSlot::clipOrderChanged()
116void ClipSlot::clipPositionChanged()
128 assert (v.hasType (IDs::CLIPSLOTS));
130 for (
auto child :
state)
131 if (child.hasType (IDs::CLIPSLOT))
132 EditItemID::readOrCreateNewID (
track.edit, child);
149 for (
int i = size(); i < numSlots; ++i)
152 EditItemID::readOrCreateNewID (
track.edit, newSlotState);
156 assert (objects.size() >= numSlots);
161 if (numSlots > size())
165 else if (size() > numSlots)
167 while (size() > numSlots)
175 EditItemID::readOrCreateNewID (
track.edit, newSlotState);
180void ClipSlotList::deleteSlot (
ClipSlot& cs)
189 return v.hasType (IDs::CLIPSLOT);
194 return new ClipSlot (v,
track);
197void ClipSlotList::deleteObject (ClipSlot* clipSlot)
202void ClipSlotList::newObjectAdded (ClipSlot*)
206void ClipSlotList::objectRemoved (ClipSlot*)
210void ClipSlotList::objectOrderChanged()
int indexOf(ParameterType elementToLookFor) const
bool hasType(const Identifier &typeName) const noexcept
void addChild(const ValueTree &child, int index, UndoManager *undoManager)
const juce::Array< Clip * > & getClips() const
Returns the clips this owner contains.
void initialiseClipOwner(Edit &, juce::ValueTree clipParentState)
Must be called once from the subclass constructor to init the clip owner.
ClipSlot * insertSlot(int index)
Inserts a new slot with the given index.
juce::Array< ClipSlot * > getClipSlots() const
Returns the ClipSlot* on this Track.
~ClipSlotList() override
Destructor.
ClipSlotList(const juce::ValueTree &, Track &)
Creates a ClipSlotList for a Track.
Track & track
The Track this ClipSlotList belongs to.
juce::ValueTree state
The state of this ClipSlotList.
void setNumberOfSlots(int numSlots)
Adds or removes Slots to ensure the exact number of slots exist.
void ensureNumberOfSlots(int numSlots)
Adds Slots to ensure at least numSlots exist.
Represents a slot on a track that a Clip can live in to be played as a launched clip.
juce::ValueTree & getClipOwnerState() override
Must return the state of this ClipOwner.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
Edit & getClipOwnerEdit() override
Must return the Edit this ClipOwner belongs to.
EditItemID getClipOwnerID() override
Must return the ID of this ClipOwner.
ClipSlot(const juce::ValueTree &, Track &)
Creates a ClipSlot for a given Track.
Clip * getClip()
Returns the currently set clip.
Track & track
The Track this ClipSlot belongs to.
int getIndex()
Returns slot index on track.
void setClip(Clip *)
Sets the Clip to be used within this slot.
~ClipSlot() override
Destructor.
Selectable * getClipOwnerSelectable() override
Must return the selectable if this ClipOwner is one.
juce::ValueTree state
The state of this ClipSlot.
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!
juce::UndoManager & getUndoManager() noexcept
Returns the juce::UndoManager used for this Edit.
EditItemCache< ClipSlot > clipSlotCache
Quick way to find and iterate all ClipSlot[s] in the Edit.
Base class for things that can be selected, and whose properties can appear in the properties panel.
Base class for tracks which contain clips and plugins and can be added to Edit[s].
#define TRANS(stringLiteral)
Clip * findClipForID(ClipOwner &co, EditItemID id)
Returns a clip with the given ID if the ClipOwner contains it.
ID for objects of type EditElement - e.g.