11namespace tracktion {
inline namespace engine
134Clip*
split (Clip&, TimePosition);
140template<
typename ClipType>
144template<
typename ClipType>
213template<
typename ClipType>
219 if (
auto typedClip =
dynamic_cast<ClipType*
> (clip))
220 clips.
add (typedClip);
225template<
typename ClipType>
230 results.
addArray (getClipsOfType<ClipType> (parent));
233 if (
auto clipOwner =
dynamic_cast<ClipOwner*
> (clip))
234 results.
addArray (getClipsOfTypeRecursive<ClipType> (*clipOwner));
void addArray(const Type *elementsToAdd, int numElementsToAdd)
void add(const ElementType &newElement)
Base class for items that can contain clips.
ClipOwner()
Constructs an empty ClipOwner.
const juce::Array< Clip * > & getClips() const
Returns the clips this owner contains.
virtual void clipOrderChanged()=0
Called when clips have moved times so that their order has changed.
void initialiseClipOwner(Edit &, juce::ValueTree clipParentState)
Must be called once from the subclass constructor to init the clip owner.
virtual Selectable * getClipOwnerSelectable()=0
Must return the selectable if this ClipOwner is one.
virtual Edit & getClipOwnerEdit()=0
Must return the Edit this ClipOwner belongs to.
virtual ~ClipOwner()
Destructor.
virtual void clipCreated(Clip &)=0
Called when a clip is created which could be during Edit load.
virtual void clipAddedOrRemoved()=0
Called when a clip is added or removed.
virtual void clipPositionChanged()=0
Called when a clip start or end position has changed.
virtual EditItemID getClipOwnerID()=0
Must return the ID of this ClipOwner.
virtual juce::ValueTree & getClipOwnerState()=0
Must return the state of this ClipOwner.
The Tracktion Edit class!
Base class for things that can be selected, and whose properties can appear in the properties panel.
Type
Defines the types of item that can live on Track[s].
Base class for tracks which contain clips and plugins and can be added to Edit[s].
juce::Array< ClipType * > getClipsOfType(const ClipOwner &)
Returns the subclips of the given type.
bool containsAnyMIDIClips(const ClipOwner &co)
Returns true if the clip owner contains any MIDI clips.
bool canContainMIDI(const ClipOwner &co)
Returns true if this Track can contain MidiClip[s].
Clip * findClipForState(ClipOwner &co, const juce::ValueTree &v)
Returns a clip with the given state if the ClipOwner contains it.
bool canContainAudio(const ClipOwner &co)
Returns true if this Track can contain WaveAudioClip[s].
Clip * findClipForID(ClipOwner &co, EditItemID id)
Returns a clip with the given ID if the ClipOwner contains it.
bool isOnTop(const Track &track)
Returns true if this a global Track and should be on top of others.
bool isAutomationTrack(const Track &t)
Returns true if this is an AutomationTrack.
bool isFolderTrack(const Track &t)
Returns true if this is a FolderTrack.
juce::Array< Clip * > deleteRegion(ClipOwner &parent, TimeRange range)
Removes a region of a ClipOwner and returns any newly created clips.
bool isAudioTrack(const Track &t)
Returns true if this is an AudioTrack.
bool isMovable(const Track &)
Returns true if this Track is movable.
bool isArrangerTrack(const Track &t)
Returns true if this is an ArrangerTrack.
MidiClip::Ptr insertMIDIClip(ClipOwner &parent, const juce::String &name, TimeRange position)
Inserts a new MidiClip into the ClipOwner's clip list.
juce::ReferenceCountedObjectPtr< WaveAudioClip > insertWaveClip(ClipOwner &parent, const juce::String &name, const juce::File &sourceFile, ClipPosition position, DeleteExistingClips deleteExistingClips)
Inserts a new WaveAudioClip into the ClipOwner's clip list.
bool isMarkerTrack(const Track &t)
Returns true if this is a MarkerTrack.
EditClip::Ptr insertEditClip(ClipOwner &parent, TimeRange position, ProjectItemID sourceID)
Inserts a new EditClip into the ClipOwner's clip list.
juce::Array< ClipType * > getClipsOfTypeRecursive(const ClipOwner &)
Returns the subclips of the given type, if any clips contain other clips, this will also return those...
bool isChordTrack(const Track &t)
Returns true if this is a ChordTrack.
Clip * insertNewClip(ClipOwner &parent, TrackItem::Type type, const juce::String &name, EditTimeRange pos)
Inserts a new clip with the given type and name.
DeleteExistingClips
Determines behaviour for overwriting clips.
Clip * insertClipWithState(ClipOwner &clipOwner, juce::ValueTree clipState)
Inserts a clip with the given state in to the ClipOwner's clip list.
bool isMasterTrack(const Track &t)
Returns true if this is a MasterTrack.
juce::Array< Clip * > split(ClipOwner &parent, TimePosition time)
Splits the given clp owner at the time and returns any newly created clips.
bool isTempoTrack(const Track &t)
Returns true if this is a TempoTrack.
ID for objects of type EditElement - e.g.