Audacity 3.2.0
Static Public Member Functions | List of all members
SyncLock Class Reference

#include <SyncLock.h>

Static Public Member Functions

static bool IsSyncLockSelected (const Track *pTrack)
static bool IsSelectedOrSyncLockSelected (const Track *pTrack)
static TrackIterRange< TrackGroup (Track *pTrack)
static TrackIterRange< const TrackGroup (const Track *pTrack)

Detailed Description

Definition at line 41 of file SyncLock.h.

Member Function Documentation

◆ Group() [1/2]

static TrackIterRange< const Track > SyncLock::Group ( const Track pTrack)

pTrack->GetOwner() != nullptr

Definition at line 53 of file SyncLock.h.

54 {
55 return Group(const_cast<Track*>(pTrack)).Filter<const Track>();
56 }
static TrackIterRange< Track > Group(Track *pTrack)
Definition: SyncLock.cpp:161
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122

◆ Group() [2/2]

TrackIterRange< Track > SyncLock::Group ( Track pTrack)
pTrack->GetOwner() != nullptr

Definition at line 161 of file SyncLock.cpp.

163 auto pList = pTrack->GetOwner();
164 auto tracks = FindSyncLockGroup(const_cast<Track*>( pTrack ) );
165 return pList->Any()
166 .StartingWith(tracks.first).EndingAfter(tracks.second);
const auto tracks
std::shared_ptr< TrackList > GetOwner() const
Definition: Track.h:254
std::pair< Track *, Track * > FindSyncLockGroup(Track *pMember)
Definition: SyncLock.cpp:118

References anonymous_namespace{SyncLock.cpp}::FindSyncLockGroup(), Track::GetOwner(), and tracks.

Referenced by ClipMoveState::Init(), IsSyncLockSelected(), anonymous_namespace{EditMenus.cpp}::OnPaste(), NyquistEffect::Process(), EffectTruncSilence::ProcessIndependently(), NyquistEffect::ProcessOne(), StretchHandle::Release(), SelectionState::SelectTrackLength(), and RateMenuTable::SetRate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSelectedOrSyncLockSelected()

bool SyncLock::IsSelectedOrSyncLockSelected ( const Track pTrack)
pTrack is not null, and is selected, or is sync-lock selected

Definition at line 112 of file SyncLock.cpp.

114 return pTrack && (pTrack->IsSelected() || IsSyncLockSelected(pTrack));
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:82
bool IsSelected() const
Definition: Track.cpp:288

References Track::IsSelected(), and IsSyncLockSelected().

Referenced by anonymous_namespace{TrackMenus.cpp}::DoAlign(), EffectTruncSilence::DoRemoval(), LabelTrackView::Draw(), TrackArt::DrawBackgroundWithSelection(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), EffectOutputTracks::EffectOutputTracks(), anonymous_namespace{EditMenus.cpp}::OnCut(), anonymous_namespace{EditMenus.cpp}::OnDelete(), EffectChangeSpeed::Process(), EffectRepeat::Process(), and EffectReverse::Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSyncLockSelected()

bool SyncLock::IsSyncLockSelected ( const Track pTrack)
pTrack is not null, sync lock is on, and some member of its group is selected

Definition at line 82 of file SyncLock.cpp.

84 if (!pTrack)
85 return false;
86 auto pList = pTrack->GetOwner();
87 if (!pList)
88 return false;
90 auto p = pList->GetOwner();
91 if (!p || !SyncLockState::Get( *p ).IsSyncLocked())
92 return false;
94 auto shTrack = pTrack->SubstituteOriginalTrack();
95 if (!shTrack)
96 return false;
98 const auto pOrigTrack = shTrack.get();
99 auto trackRange = Group( pOrigTrack );
101 if (trackRange.size() <= 1) {
102 // Not in a sync-locked group.
103 // Return true iff selected and of a sync-lockable type.
104 return (IsSyncLockableNonSeparatorTrack( pOrigTrack ) ||
105 IsSeparatorTrack( pOrigTrack )) && pTrack->GetSelected();
106 }
108 // Return true iff any track in the group is selected.
109 return *(trackRange + &Track::IsSelected).begin();
bool IsSyncLocked() const
Definition: SyncLock.cpp:43
static SyncLockState & Get(AudacityProject &project)
Definition: SyncLock.cpp:26
bool GetSelected() const
Selectedness is always the same for all channels of a group.
Definition: Track.cpp:70
std::shared_ptr< const Track > SubstituteOriginalTrack() const
Definition: Track.cpp:1185
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:150
bool IsSeparatorTrack(const Track *pTrack)
Definition: SyncLock.cpp:62
bool IsSyncLockableNonSeparatorTrack(const Track *pTrack)
Definition: SyncLock.cpp:57

References PackedArray::begin(), SyncLockState::Get(), Track::GetOwner(), Track::GetSelected(), Group(), Track::IsSelected(), anonymous_namespace{SyncLock.cpp}::IsSeparatorTrack(), anonymous_namespace{SyncLock.cpp}::IsSyncLockableNonSeparatorTrack(), SyncLockState::IsSyncLocked(), and Track::SubstituteOriginalTrack().

Referenced by anonymous_namespace{LabelMenus.cpp}::EditByLabel(), anonymous_namespace{LabelMenus.cpp}::EditClipboardByLabel(), IsSelectedOrSyncLockSelected(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), SelectActions::Handler::OnSelectSyncLockSel(), EffectChangeSpeed::Process(), Generator::Process(), EffectPaulstretch::Process(), EffectRepeat::Process(), EffectSBSMS::Process(), NyquistEffect::ProcessOne(), and PerTrackEffect::ProcessPass().

Here is the call graph for this function:
Here is the caller graph for this function:

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