TracktionEngine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::TrackList Struct Reference

An iterable list of Track[s] that live either in an Edit or as subtracks of a Track. More...

Inheritance diagram for tracktion::engine::TrackList:

Public Member Functions

 TrackList (Edit &, const juce::ValueTree &parent)
 Creates a TrackList for a parent state. More...
 
 ~TrackList () override
 Destructor. More...
 
TrackgetTrackFor (const juce::ValueTree &) const
 Returns a Track for a given state. More...
 
bool visitAllRecursive (const std::function< bool(Track &)> &) const
 Calls the given function on all Track[s]. More...
 
void visitAllTopLevel (const std::function< bool(Track &)> &) const
 Calls the given function on all top-level Track[s]. More...
 
void visitAllTracks (const std::function< bool(Track &)> &, bool recursive) const
 Calls the given function on all Track[s], optionally recursively. More...
 
bool isSuitableType (const juce::ValueTree &) const override
 
TrackcreateNewObject (const juce::ValueTree &) override
 
void deleteObject (Track *t) override
 
void newObjectAdded (Track *t) override
 
void objectRemoved (Track *) override
 
void objectOrderChanged () override
 
- Public Member Functions inherited from tracktion::engine::ValueTreeObjectList< Track >
 ValueTreeObjectList (const juce::ValueTree &parentTree)
 
 ~ValueTreeObjectList () override
 
int size () const
 
bool isEmpty () const noexcept
 
Trackoperator[] (int idx) const
 
Trackat (int idx)
 
Track ** begin ()
 
Track *const * begin () const
 
Track ** end ()
 
Track *const * end () const
 
void rebuildObjects ()
 
void freeObjects ()
 
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &tree) override
 
void valueTreeChildRemoved (juce::ValueTree &exParent, juce::ValueTree &tree, int) override
 
void valueTreeChildOrderChanged (juce::ValueTree &tree, int, int) override
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
void valueTreeRedirected (juce::ValueTree &) override
 
int compareElements (Track *first, Track *second) const
 
 ValueTreeObjectList (const juce::ValueTree &parentTree)
 
 ~ValueTreeObjectList () override
 
int size () const
 
bool isEmpty () const noexcept
 
Trackoperator[] (int idx) const
 
Trackat (int idx)
 
Track ** begin ()
 
Track *const * begin () const
 
Track ** end ()
 
Track *const * end () const
 
void rebuildObjects ()
 
void freeObjects ()
 
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &tree) override
 
void valueTreeChildRemoved (juce::ValueTree &exParent, juce::ValueTree &tree, int) override
 
void valueTreeChildOrderChanged (juce::ValueTree &tree, int, int) override
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
void valueTreeRedirected (juce::ValueTree &) override
 
int compareElements (Track *first, Track *second) const
 

Static Public Member Functions

static bool isMovableTrack (const juce::ValueTree &) noexcept
 Returns true if the track is movable. More...
 
static bool isArrangerTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for an ArrangerTrack. More...
 
static bool isChordTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a ChordTrack. More...
 
static bool isMarkerTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a MarkerTrack. More...
 
static bool isTempoTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a TempoTrack. More...
 
static bool isMasterTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a MasterTrack. More...
 
static bool isFixedTrack (const juce::ValueTree &) noexcept
 Returns true if the track is fixed. More...
 
static bool isTrack (const juce::ValueTree &) noexcept
 Returns true if the given ValeTree is for a known Track type. More...
 
static bool isTrack (const juce::Identifier &) noexcept
 Returns true if the given Identifier is for a known Track type. More...
 
static bool hasAnySubTracks (const juce::ValueTree &)
 Returns true if the track has any sub tracks. More...
 
static void sortTracksByType (juce::ValueTree &editState, juce::UndoManager *)
 Sorts a list of tracks by their type, placing global tracks at the top. More...
 

Public Attributes

Editedit
 
bool rebuilding = true
 
- Public Attributes inherited from tracktion::engine::ValueTreeObjectList< Track >
juce::Array< Track * > objects
 
juce::DummyCriticalSection arrayLock
 
juce::Array< Track * > objects
 
juce::DummyCriticalSection arrayLock
 

Additional Inherited Members

- Public Types inherited from tracktion::engine::ValueTreeObjectList< Track >
using ScopedLockType = typename CriticalSectionType::ScopedLockType
 
using ScopedLockType = typename CriticalSectionType::ScopedLockType
 
- Protected Member Functions inherited from tracktion::engine::ValueTreeObjectList< Track >
void deleteAllObjects ()
 
bool isChildTree (juce::ValueTree &v) const
 
int indexOf (const juce::ValueTree &v) const noexcept
 
void sortArray ()
 
void deleteAllObjects ()
 
bool isChildTree (juce::ValueTree &v) const
 
int indexOf (const juce::ValueTree &v) const noexcept
 
void sortArray ()
 
- Protected Attributes inherited from tracktion::engine::ValueTreeObjectList< Track >
juce::ValueTree parent
 
juce::ValueTree parent
 

Detailed Description

An iterable list of Track[s] that live either in an Edit or as subtracks of a Track.

See also
Edit::getTrackList, Track::getSubTrackList

Constructor & Destructor Documentation

◆ TrackList()

tracktion::engine::TrackList::TrackList ( Edit ,
const juce::ValueTree &  parent 
)

Creates a TrackList for a parent state.

◆ ~TrackList()

tracktion::engine::TrackList::~TrackList ( )
override

Destructor.

Member Function Documentation

◆ getTrackFor()

Track* tracktion::engine::TrackList::getTrackFor ( const juce::ValueTree &  ) const

Returns a Track for a given state.

◆ visitAllRecursive()

bool tracktion::engine::TrackList::visitAllRecursive ( const std::function< bool(Track &)> &  ) const

Calls the given function on all Track[s].

Return false from the function to stop the traversal.

Returns
true if all tracks were visited, false otherwise

◆ visitAllTopLevel()

void tracktion::engine::TrackList::visitAllTopLevel ( const std::function< bool(Track &)> &  ) const

Calls the given function on all top-level Track[s].

Return false from the function to stop the traversal.

Returns
true if all tracks were visited, false otherwise

◆ visitAllTracks()

void tracktion::engine::TrackList::visitAllTracks ( const std::function< bool(Track &)> &  ,
bool  recursive 
) const

Calls the given function on all Track[s], optionally recursively.

Return false from the function to stop the traversal.

Parameters
recursiveWhether nested tracks should be visited
Returns
true if all tracks were visited, false otherwise

◆ isMovableTrack()

static bool tracktion::engine::TrackList::isMovableTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the track is movable.

I.e. not a global track.

◆ isArrangerTrack()

static bool tracktion::engine::TrackList::isArrangerTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the state is for an ArrangerTrack.

◆ isChordTrack()

static bool tracktion::engine::TrackList::isChordTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the state is for a ChordTrack.

◆ isMarkerTrack()

static bool tracktion::engine::TrackList::isMarkerTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the state is for a MarkerTrack.

◆ isTempoTrack()

static bool tracktion::engine::TrackList::isTempoTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the state is for a TempoTrack.

◆ isMasterTrack()

static bool tracktion::engine::TrackList::isMasterTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the state is for a MasterTrack.

◆ isFixedTrack()

static bool tracktion::engine::TrackList::isFixedTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the track is fixed.

I.e. a global track.

See also
TempoTrack, MarkerTrack, ChordTrack, ArrangerTrack

◆ isTrack() [1/2]

static bool tracktion::engine::TrackList::isTrack ( const juce::ValueTree &  )
staticnoexcept

Returns true if the given ValeTree is for a known Track type.

◆ isTrack() [2/2]

static bool tracktion::engine::TrackList::isTrack ( const juce::Identifier &  )
staticnoexcept

Returns true if the given Identifier is for a known Track type.

◆ hasAnySubTracks()

static bool tracktion::engine::TrackList::hasAnySubTracks ( const juce::ValueTree &  )
static

Returns true if the track has any sub tracks.

See also
FolderTrack, AutomationTrack

◆ sortTracksByType()

static void tracktion::engine::TrackList::sortTracksByType ( juce::ValueTree &  editState,
juce::UndoManager *   
)
static

Sorts a list of tracks by their type, placing global tracks at the top.

◆ isSuitableType()

bool tracktion::engine::TrackList::isSuitableType ( const juce::ValueTree &  ) const
overridevirtual

◆ createNewObject()

Track* tracktion::engine::TrackList::createNewObject ( const juce::ValueTree &  )
overridevirtual

◆ deleteObject()

void tracktion::engine::TrackList::deleteObject ( Track t)
overridevirtual

◆ newObjectAdded()

void tracktion::engine::TrackList::newObjectAdded ( Track t)
overridevirtual

◆ objectRemoved()

void tracktion::engine::TrackList::objectRemoved ( Track )
overridevirtual

◆ objectOrderChanged()

void tracktion::engine::TrackList::objectOrderChanged ( )
overridevirtual

Member Data Documentation

◆ edit

Edit& tracktion::engine::TrackList::edit

◆ rebuilding

bool tracktion::engine::TrackList::rebuilding = true

The documentation for this struct was generated from the following file: