tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
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...

#include "tracktion_TrackUtils.h"

Inheritance diagram for tracktion::engine::TrackList:
tracktion::engine::ValueTreeObjectList< Track > juce::AsyncUpdater juce::ValueTree::Listener

Public Member Functions

 TrackList (Edit &, const juce::ValueTree &parent)
 Creates a TrackList for a parent state.
 
 ~TrackList () override
 Destructor.
 
TrackgetTrackFor (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
 
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)
 
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)
 
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.
 
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

Editedit
 
bool rebuilding
 
- 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

Definition at line 53 of file tracktion_TrackUtils.h.

Constructor & Destructor Documentation

◆ TrackList()

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

Creates a TrackList for a parent state.

Definition at line 71 of file tracktion_TrackUtils.cpp.

◆ ~TrackList()

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

Destructor.

Definition at line 78 of file tracktion_TrackUtils.cpp.

Member Function Documentation

◆ createNewObject()

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

◆ deleteObject()

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

◆ getTrackFor()

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

Returns a Track for a given state.

Definition at line 83 of file tracktion_TrackUtils.cpp.

◆ hasAnySubTracks()

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

Returns true if the track has any sub tracks.

See also
FolderTrack, AutomationTrack

Definition at line 148 of file tracktion_TrackUtils.cpp.

◆ isArrangerTrack()

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

Returns true if the state is for an ArrangerTrack.

Definition at line 127 of file tracktion_TrackUtils.cpp.

◆ isChordTrack()

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

Returns true if the state is for a ChordTrack.

Definition at line 128 of file tracktion_TrackUtils.cpp.

◆ isFixedTrack()

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

Returns true if the track is fixed.

I.e. a global track.

See also
TempoTrack, MarkerTrack, ChordTrack, ArrangerTrack

Definition at line 133 of file tracktion_TrackUtils.cpp.

◆ isMarkerTrack()

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

Returns true if the state is for a MarkerTrack.

Definition at line 129 of file tracktion_TrackUtils.cpp.

◆ isMasterTrack()

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

Returns true if the state is for a MasterTrack.

Definition at line 131 of file tracktion_TrackUtils.cpp.

◆ isMovableTrack()

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

Returns true if the track is movable.

I.e. not a global track.

Definition at line 122 of file tracktion_TrackUtils.cpp.

◆ isSuitableType()

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

◆ isTempoTrack()

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

Returns true if the state is for a TempoTrack.

Definition at line 130 of file tracktion_TrackUtils.cpp.

◆ isTrack() [1/2]

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

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

Definition at line 141 of file tracktion_TrackUtils.cpp.

◆ isTrack() [2/2]

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

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

Definition at line 139 of file tracktion_TrackUtils.cpp.

◆ newObjectAdded()

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

◆ objectOrderChanged()

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

◆ objectRemoved()

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

◆ sortTracksByType()

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

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

Definition at line 226 of file tracktion_TrackUtils.cpp.

◆ visitAllRecursive()

bool tracktion::engine::TrackList::visitAllRecursive ( const std::function< bool(Track &)> &  f) 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

Definition at line 92 of file tracktion_TrackUtils.cpp.

◆ visitAllTopLevel()

void tracktion::engine::TrackList::visitAllTopLevel ( const std::function< bool(Track &)> &  f) 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

Definition at line 107 of file tracktion_TrackUtils.cpp.

◆ visitAllTracks()

void tracktion::engine::TrackList::visitAllTracks ( const std::function< bool(Track &)> &  f,
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

Definition at line 114 of file tracktion_TrackUtils.cpp.

Member Data Documentation

◆ edit

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

Definition at line 138 of file tracktion_TrackUtils.h.

◆ rebuilding

bool tracktion::engine::TrackList::rebuilding

Definition at line 139 of file tracktion_TrackUtils.h.


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