Audacity  2.2.0
TrackList Class Referencefinal

A list of TrackListNode items. More...

#include <Track.h>

Inheritance diagram for TrackList:

Public Member Functions

TrackListoperator= (const TrackList &that)
TrackListoperator= (TrackList &&)
void Swap (TrackList &that)
virtual ~TrackList ()
void Permute (const std::vector< TrackNodePointer > &permutation)
 For use in sorting: assume each iterator points into this list, no duplications. More...
template<typename TrackKind >
TrackAdd (std::unique_ptr< TrackKind > &&t)
 Add this Track or all children of this TrackList. More...
template<typename TrackKind >
TrackAddToHead (std::unique_ptr< TrackKind > &&t)
template<typename TrackKind >
TrackAdd (std::shared_ptr< TrackKind > &&t)
value_type Replace (Track *t, value_type &&with)
 Replace first track with second track, give back a holder. More...
TrackNodePointer Remove (Track *t)
void Clear (bool sendEvent=true)
 Make the list empty. More...
void Select (Track *t, bool selected=true)
TrackGetPrev (Track *t, bool linked=false) const
TrackGetNext (Track *t, bool linked=false) const
 Return a track in the list that comes after Track t. More...
int GetGroupHeight (Track *t) const
bool CanMoveUp (Track *t) const
bool CanMoveDown (Track *t) const
bool MoveUp (Track *t)
bool MoveDown (Track *t)
bool Move (Track *t, bool up)
TimeTrackGetTimeTrack ()
const TimeTrackGetTimeTrack () const
unsigned GetNumExportChannels (bool selectionOnly) const
 Find out how many channels this track list mixes to. More...
WaveTrackArray GetWaveTrackArray (bool selectionOnly, bool includeMuted=true)
WaveTrackConstArray GetWaveTrackConstArray (bool selectionOnly, bool includeMuted=true) const
bool Contains (const Track *t) const
 Mainly a test function. Uses a linear search, so could be slow. More...
template<typename Subclass >
std::shared_ptr< Subclass > Lock (const std::weak_ptr< Subclass > &wTrack)
bool IsEmpty () const
int GetCount () const
double GetStartTime () const
double GetEndTime () const
double GetMinOffset () const
int GetHeight () const

Static Public Member Functions

static std::shared_ptr< TrackListCreate ()

Private Member Functions

 TrackList ()
 TrackList (const TrackList &that)=delete
 TrackList (TrackList &&that)=delete
void clear ()=delete
bool isNull (TrackNodePointer p) const
void setNull (TrackNodePointer &p)
bool hasPrev (TrackNodePointer p) const
void DoAssign (const TrackList &that)
void RecalcPositions (TrackNodePointer node)
void PermutationEvent ()
void DeletionEvent ()
void ResizingEvent (TrackNodePointer node)
void SwapNodes (TrackNodePointer s1, TrackNodePointer s2)

Private Attributes

std::weak_ptr< TrackListmSelf


class Track
class TrackListIterator
class SyncLockedTracksIterator

Detailed Description

A list of TrackListNode items.

Constructor & Destructor Documentation

TrackList::TrackList ( )
TrackList::TrackList ( const TrackList that)
TrackList::TrackList ( TrackList &&  that)
TrackList::~TrackList ( )

References Clear().

Member Function Documentation

template<typename TrackKind >
Track * TrackList::Add ( std::shared_ptr< TrackKind > &&  t)
template<typename TrackKind >
template Track * TrackList::AddToHead< TimeTrack > ( std::unique_ptr< TrackKind > &&  t)
bool TrackList::CanMoveDown ( Track t) const
bool TrackList::CanMoveUp ( Track t) const
void TrackList::clear ( )

Referenced by TimeShiftHandle::Click().

void TrackList::Clear ( bool  sendEvent = true)

Make the list empty.

References DeletionEvent().

Referenced by operator=(), and ~TrackList().

bool TrackList::Contains ( const Track t) const

Mainly a test function. Uses a linear search, so could be slow.

void TrackList::DeletionEvent ( )

Referenced by Clear(), and Remove().

void TrackList::DoAssign ( const TrackList that)
int TrackList::GetCount ( ) const

Referenced by SelectCommand::Apply().

int TrackList::GetGroupHeight ( Track t) const

For mono track height of track For stereo track combined height of both channels.

References Track::GetHeight(), and Track::GetLink().

Referenced by TrackSelectHandle::CalculateRearrangingThresholds().

int TrackList::GetHeight ( ) const
double TrackList::GetMinOffset ( ) const

References Track::GetOffset().

Referenced by SelectCommand::Apply().

Track * TrackList::GetNext ( Track t,
bool  linked = false 
) const

Return a track in the list that comes after Track t.

Return a track in the list that comes after Track t

ta track in the list
linkedif true, skips over linked tracks, if false returns the next track even if it is a linked track

References Track::GetLinked(), Track::GetNode(), and isNull().

Referenced by TrackSelectHandle::CalculateRearrangingThresholds(), TrackPanelResizeHandle::Cancel(), CanMoveDown(), TrackPanelResizeHandle::Drag(), WaveTrackMenuTable::InitMenu(), SyncLockedTracksIterator::Last(), and MoveDown().

unsigned TrackList::GetNumExportChannels ( bool  selectionOnly) const

Find out how many channels this track list mixes to.

This is used in exports of the tracks to work out whether to export in Mono, Stereo etc.

selectionOnlyWhether to consider the entire track list or only the selected members of it

References TrackListConstIterator::First(), Track::GetChannel(), Track::GetKind(), WaveTrack::GetPan(), Track::GetSelected(), Track::LeftChannel, Track::MonoChannel, TrackListConstIterator::Next(), Track::RightChannel, and Track::Wave.

Referenced by ExportMultiple::ExportMultipleByLabel().

const TimeTrack * TrackList::GetTimeTrack ( ) const

References GetTimeTrack().

WaveTrackArray TrackList::GetWaveTrackArray ( bool  selectionOnly,
bool  includeMuted = true 
WaveTrackConstArray TrackList::GetWaveTrackConstArray ( bool  selectionOnly,
bool  includeMuted = true 
) const
bool TrackList::hasPrev ( TrackNodePointer  p) const
bool TrackList::IsEmpty ( ) const
bool TrackList::Move ( Track t,
bool  up 

References MoveDown(), and MoveUp().

bool TrackList::MoveDown ( Track t)

References GetNext(), Track::GetNode(), and SwapNodes().

Referenced by Move().

bool TrackList::MoveUp ( Track t)
TrackList & TrackList::operator= ( const TrackList that)

References Clear(), and DoAssign().

TrackList & TrackList::operator= ( TrackList &&  that)

References Clear(), and Swap().

void TrackList::PermutationEvent ( )

Referenced by Permute(), and SwapNodes().

void TrackList::Permute ( const std::vector< TrackNodePointer > &  permutation)

For use in sorting: assume each iterator points into this list, no duplications.

References mSelf, PermutationEvent(), RecalcPositions(), and Track::SetOwner().

void TrackList::RecalcPositions ( TrackNodePointer  node)
TrackNodePointer TrackList::Remove ( Track t)

Remove this Track or all children of this TrackList. Return an iterator to what followed the removed track.

References DeletionEvent(), Track::GetNode(), isNull(), RecalcPositions(), and Track::SetOwner().

Referenced by ControlToolBar::OnRecord(), TrackListIterator::RemoveCurrent(), and Effect::ReplaceProcessedTracks().

auto TrackList::Replace ( Track t,
value_type &&  with 

Replace first track with second track, give back a holder.

References Track::SetOwner().

Referenced by Effect::ModifiedAnalysisTrack::ModifiedAnalysisTrack(), and Effect::ReplaceProcessedTracks().

void TrackList::ResizingEvent ( TrackNodePointer  node)

Referenced by Add(), and AddToHead().

void TrackList::Select ( Track t,
bool  selected = true 

Select a track, and if it is linked to another track, select it, too.

References Track::GetLinked(), Track::GetNode(), hasPrev(), isNull(), and Track::SetSelected().

Referenced by SelectionState::SelectTrack().

void TrackList::setNull ( TrackNodePointer p)
void TrackList::Swap ( TrackList that)

References mSelf.

Referenced by operator=().

void TrackList::SwapNodes ( TrackNodePointer  s1,
TrackNodePointer  s2 

Friends And Related Function Documentation

friend class SyncLockedTracksIterator
friend class Track
friend class TrackListIterator

Member Data Documentation

std::weak_ptr<TrackList> TrackList::mSelf

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