11namespace tracktion {
inline namespace engine
130 void deleteObject (
Track* t)
override;
132 void newObjectAdded (
Track* t)
override;
134 void objectRemoved (
Track*)
override;
136 void objectOrderChanged()
override;
139 bool rebuilding =
true;
142 void handleAsyncUpdate()
override;
163 if (c.getTrack() ==
track
164 && c.getEditTimeRange().overlaps (
range.expanded (TimeDuration::fromSeconds (0.0001))))
166 range =
range.getUnionWith (c.getEditTimeRange());
174 template <
typename TrackItemArray>
179 for (
auto&& c : trackItems)
181 bool segFound =
false;
183 for (
auto& dstSeg : result)
185 if (dstSeg.merge (*c))
195 cs.
range = c->getEditTimeRange();
196 cs.
track = c->getTrack();
198 if (cs.
track !=
nullptr)
252template <
typename ArrayType>
255 for (
int i = items.size(); --i >= 0;)
257 auto pos = items.getUnchecked (i)->getPosition().time;
259 if (pos.getStart() <
time)
261 if (pos.getEnd() >
time)
274template <
typename ArrayType>
280 for (
auto& item : items)
282 auto time = item->getEditTimeRange();
291 total = total.getUnionWith (
time);
void add(const ElementType &newElement)
The Tracktion Edit class!
Base class for EditItems that live in a Track, e.g.
Base class for tracks which contain clips and plugins and can be added to Edit[s].
int findIndexOfNextItemAt(const ArrayType &items, TimePosition time)
Returns the index of the next item after the given time.
void moveAutomation(const juce::Array< TrackAutomationSection > &origSections, TimeDuration offset, bool copy)
Moves a set of automation optionally applying an offset and copying the automation (rather than movin...
TimeRange findUnionOfEditTimeRanges(const ArrayType &items)
Returns the the time range that covers all the given TrackItems.
Represents a duration in real-life time.
Represents a position in real-life time.
ID for objects of type EditElement - e.g.
Holds a reference to a section of automation for a given Track.
Track::Ptr src
The time range of the automation section.
TrackAutomationSection() noexcept=default
Construts an empty section.
bool containsParameter(AutomatableParameter *) const
Tests whether this section contains a given parameter.
AutomationCurve curve
The curve section of this parameter.
void mergeIn(const TrackAutomationSection &)
The destination Track.
AutomatableParameter::Ptr param
The parameter.
Track::Ptr dst
The source Track.
juce::Array< ActiveParameters > activeParameters
A list of parameteres and their curves.
bool overlaps(const TrackAutomationSection &) const
Tests whether another section overlaps with this one.
Holds a parameter and curve section.
Defines the place to insert Track[s].
An iterable list of Track[s] that live either in an Edit or as subtracks of a Track.
static bool isMarkerTrack(const juce::ValueTree &) noexcept
Returns true if the state is for a MarkerTrack.
static bool isMasterTrack(const juce::ValueTree &) noexcept
Returns true if the state is for a MasterTrack.
Track * getTrackFor(const juce::ValueTree &) const
Returns a Track for a given state.
static void sortTracksByType(juce::ValueTree &editState, juce::UndoManager *)
Sorts a list of tracks by their type, placing global tracks at the top.
static bool isFixedTrack(const juce::ValueTree &) noexcept
Returns true if the track is fixed.
static bool isChordTrack(const juce::ValueTree &) noexcept
Returns true if the state is for a ChordTrack.
static bool isTempoTrack(const juce::ValueTree &) noexcept
Returns true if the state is for a TempoTrack.
void visitAllTracks(const std::function< bool(Track &)> &, bool recursive) const
Calls the given function on all Track[s], optionally recursively.
~TrackList() override
Destructor.
void visitAllTopLevel(const std::function< bool(Track &)> &) const
Calls the given function on all top-level Track[s].
static bool isTrack(const juce::ValueTree &) noexcept
Returns true if the given ValeTree is for a known Track type.
static bool isArrangerTrack(const juce::ValueTree &) noexcept
Returns true if the state is for an ArrangerTrack.
static bool hasAnySubTracks(const juce::ValueTree &)
Returns true if the track has any sub tracks.
bool visitAllRecursive(const std::function< bool(Track &)> &) const
Calls the given function on all Track[s].
static bool isMovableTrack(const juce::ValueTree &) noexcept
Returns true if the track is movable.
Defines a time raneg sectin of a Track.
TimeRange range
The time range this section refers to.
bool merge(const TrackItem &c)
Merges an overlapping TrackItem track/time range with this section.
Track * track
The Track this section refers to.
static juce::Array< TrackSection > findSections(const TrackItemArray &trackItems)
Returns a set of TrackSections for the given TrackItems.