11namespace tracktion {
inline namespace engine
14CollectionClip::CollectionClip (Track& t)
15 : TrackItem (t.edit, {}, Type::collection),
20CollectionClip::~CollectionClip()
22 notifyListenersOfDeletion();
25void CollectionClip::addClip (Clip* clip)
30 jassert (! clips.contains (clip));
31 jassert (! isGroupCollection() || (clip->getTrack() ==
nullptr || clip->getTrack() == getTrack()));
34 clips.addIfNotAlreadyThere (clip);
38void CollectionClip::removeClip (Clip* clip)
41 while (clips.contains (clip))
42 clips.removeObject (clip);
45bool CollectionClip::removeClip (EditItemID clipID)
51 if (c->itemID == clipID)
53 clips.removeObject (c);
62bool CollectionClip::moveToTrack (Track& newTrack)
64 auto to =
dynamic_cast<ClipTrack*
> (&newTrack);
65 auto from =
dynamic_cast<ClipTrack*
> (track);
67 if (to ==
nullptr ||
dynamic_cast<AudioTrack*
> (to) ==
nullptr)
70 if (track != to && from !=
nullptr)
72 if (! to->isFrozen (Track::anyFreeze))
74 CollectionClip::Ptr refHolder (
this);
76 from->removeCollectionClip (
this);
78 to->addCollectionClip (
this);
85FolderTrack* CollectionClip::getFolderTrack() const noexcept
87 return dynamic_cast<FolderTrack*
> (track);
90void CollectionClip::updateStartAndEnd()
92 if (! clips.isEmpty())
98 return TRANS(
"Collection Clip");
#define TRANS(stringLiteral)
TimeRange findUnionOfEditTimeRanges(const ArrayType &items)
Returns the the time range that covers all the given TrackItems.