TracktionEngine
Loading...
Searching...
No Matches
engine::TrackList Struct Reference

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

#include <tracktion_TrackUtils.h>

Inheritance diagram for engine::TrackList:

Public Member Functions

 TrackList (Edit &, const juce::ValueTree &parent)
 Creates a TrackList for a parent state.
 ~TrackList () override
 Destructor.
void initialise ()
 Initialises the TrackList, building the child objects.
Track * getTrackFor (const juce::ValueTree &) const
 Returns a Track for a given state.
bool visitAllRecursive (const std::function< bool(Track &)> &) const
 Calls the given function on all Track[s].
void visitAllTopLevel (const std::function< bool(Track &)> &) const
 Calls the given function on all top-level Track[s].
void visitAllTracks (const std::function< bool(Track &)> &, bool recursive) const
 Calls the given function on all Track[s], optionally recursively.
bool isSuitableType (const juce::ValueTree &) const override
Track * createNewObject (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 engine::ValueTreeObjectList< Track >
 ValueTreeObjectList (const juce::ValueTree &parentTree)
 ~ValueTreeObjectList () override
int size () const
bool isEmpty () const noexcept
Track * operator[] (int idx) const
Track * at (int idx)
Track ** begin ()
Track ** end ()
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.
static bool isArrangerTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for an ArrangerTrack.
static bool isChordTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a ChordTrack.
static bool isMarkerTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a MarkerTrack.
static bool isTempoTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a TempoTrack.
static bool isMasterTrack (const juce::ValueTree &) noexcept
 Returns true if the state is for a MasterTrack.
static bool isFixedTrack (const juce::ValueTree &) noexcept
 Returns true if the track is fixed.
static bool isTrack (const juce::ValueTree &) noexcept
 Returns true if the given ValeTree is for a known Track type.
static bool isTrack (const juce::Identifier &) noexcept
 Returns true if the given Identifier is for a known Track type.
static bool hasAnySubTracks (const juce::ValueTree &)
 Returns true if the track has any sub tracks.
static void sortTracksByType (juce::ValueTree &editState, juce::UndoManager *)
 Sorts a list of tracks by their type, placing global tracks at the top.

Public Attributes

Edit & edit
bool rebuilding = true
Public Attributes inherited from engine::ValueTreeObjectList< Track >
juce::Array< Track * > objects
juce::DummyCriticalSection arrayLock

Additional Inherited Members

Public Types inherited from engine::ValueTreeObjectList< Track >
using ScopedLockType
Protected Member Functions inherited from engine::ValueTreeObjectList< Track >
void deleteAllObjects ()
bool isChildTree (juce::ValueTree &v) const
int indexOf (const juce::ValueTree &v) const noexcept
void sortArray ()
Protected Attributes inherited from engine::ValueTreeObjectList< Track >
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()

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

Creates a TrackList for a parent state.

References engine::ValueTreeObjectList< Track >::parent.

◆ ~TrackList()

engine::TrackList::~TrackList ( )
override

Destructor.

Member Function Documentation

◆ initialise()

void engine::TrackList::initialise ( )

Initialises the TrackList, building the child objects.

◆ getTrackFor()

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

Returns a Track for a given state.

◆ visitAllRecursive()

bool 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 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 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()

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

Returns true if the track is movable.

I.e. not a global track.

◆ isArrangerTrack()

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

Returns true if the state is for an ArrangerTrack.

◆ isChordTrack()

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

Returns true if the state is for a ChordTrack.

◆ isMarkerTrack()

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

Returns true if the state is for a MarkerTrack.

◆ isTempoTrack()

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

Returns true if the state is for a TempoTrack.

◆ isMasterTrack()

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

Returns true if the state is for a MasterTrack.

◆ isFixedTrack()

bool 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]

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

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

◆ isTrack() [2/2]

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

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

◆ hasAnySubTracks()

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

Returns true if the track has any sub tracks.

See also
FolderTrack, AutomationTrack

◆ sortTracksByType()

void 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 engine::TrackList::isSuitableType ( const juce::ValueTree & ) const
overridevirtual

◆ createNewObject()

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

◆ deleteObject()

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

◆ newObjectAdded()

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

◆ objectRemoved()

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

◆ objectOrderChanged()

void engine::TrackList::objectOrderChanged ( )
overridevirtual

Member Data Documentation

◆ edit

Edit& engine::TrackList::edit

◆ rebuilding

bool engine::TrackList::rebuilding = true

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