![]() |
Audacity 3.2.0
|
Abstract base class for an object holding data associated with points on a time axis. More...
#include <Track.h>
Classes | |
struct | ProtectedCreationArg |
Empty argument passed to some public constructors. More... | |
struct | TypeInfo |
struct | TypeNames |
Names of a track type for various purposes. More... | |
Public Types | |
using | AttachedObjects = ::AttachedTrackObjects |
Alias for my base type. More... | |
using | Holder = std::shared_ptr< Track > |
![]() | |
using | DataType = ClientData |
using | DataPointer = Pointer< ClientData > |
using | DataFactory = std::function< DataPointer(Host &) > |
Type of function from which RegisteredFactory is constructed; it builds attachments. More... | |
![]() | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
using | Attachments = ClientData::Site< ChannelGroupData, ClientData::Cloneable<>, ClientData::DeepCopying > |
using | Interval = WideChannelGroupInterval |
Public Member Functions | |
TrackId | GetId () const |
template<typename Subclass = Track> | |
std::shared_ptr< Subclass > | SharedPointer () |
template<typename Subclass = const Track> | |
auto | SharedPointer () const -> std::enable_if_t< std::is_const_v< Subclass >, std::shared_ptr< Subclass > > |
std::shared_ptr< Track > | SubstitutePendingChangedTrack () |
std::shared_ptr< const Track > | SubstitutePendingChangedTrack () const |
std::shared_ptr< const Track > | SubstituteOriginalTrack () const |
virtual const TypeInfo & | GetTypeInfo () const =0 |
virtual const TypeNames & | GetTypeNames () const |
virtual bool | SupportsBasicEditing () const |
Whether this track type implements cut-copy-paste; by default, true. More... | |
virtual Holder | PasteInto (AudacityProject &project, TrackList &list) const =0 |
virtual bool | LinkConsistencyFix (bool doFix=true) |
Check consistency of channel groups, and maybe fix it. More... | |
bool | LinkConsistencyCheck () |
Do the non-mutating part of consistency fix only and return status. More... | |
bool | HasOwner () const |
std::shared_ptr< TrackList > | GetOwner () const |
TrackList * | GetHolder () const |
LinkType | GetLinkType () const noexcept |
ChannelGroupData & | GetGroupData () |
const ChannelGroupData & | GetGroupData () const |
May make group data on demand, but consider that logically const. More... | |
Track () | |
Track (const Track &orig, ProtectedCreationArg &&) | |
Track & | operator= (const Track &orig)=delete |
virtual | ~Track () |
void | Init (const Track &orig) |
virtual TrackListHolder | Duplicate () const |
public nonvirtual duplication function that invokes Clone() More... | |
const wxString & | GetName () const |
Name is always the same for all channels of a group. More... | |
void | SetName (const wxString &n) |
bool | GetSelected () const |
Selectedness is always the same for all channels of a group. More... | |
virtual void | SetSelected (bool s) |
void | OnProjectTempoChange (double newTempo) |
method to set project tempo on track More... | |
virtual TrackListHolder | Cut (double t0, double t1)=0 |
Create tracks and modify this track. More... | |
virtual TrackListHolder | Copy (double t0, double t1, bool forClipboard=true) const =0 |
Create new tracks and don't modify this track. More... | |
virtual void | Clear (double t0, double t1)=0 |
virtual void | Paste (double t, const Track &src)=0 |
Weak precondition allows overrides to replicate one channel into many. More... | |
void | Paste (double t, const TrackList &src) |
virtual void | SyncLockAdjust (double oldT1, double newT1) |
virtual void | Silence (double t0, double t1, ProgressReporter reportProgress={})=0 |
virtual void | InsertSilence (double t, double len)=0 |
bool | SameKindAs (const Track &track) const |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) const |
virtual void | WriteXML (XMLWriter &xmlFile) const =0 |
virtual std::optional< TranslatableString > | GetErrorOpening () const |
void | Notify (bool allChannels, int code=-1) |
bool | Any () const |
bool | IsSelected () const |
bool | IsLeader () const override |
bool | IsSelectedLeader () const |
void | AdjustPositions () |
void | WriteCommonXMLAttributes (XMLWriter &xmlFile, bool includeNameAndSelected=true) const |
bool | HandleCommonXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
const std::optional< double > & | GetProjectTempo () const |
![]() | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
![]() | |
~Site () | |
Site () | |
Site (const Site &other) | |
Site & | operator= (const Site &other) |
Site (Site &&other) | |
Site & | operator= (Site &&other) |
size_t | size () const |
How many attachment pointers are in the Site. More... | |
template<typename Subclass = ClientData> | |
Subclass & | Get (const RegisteredFactory &key) |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = const ClientData> | |
auto | Get (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass & > |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = ClientData> | |
Subclass * | Find (const RegisteredFactory &key) |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename Subclass = const ClientData> | |
auto | Find (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass * > |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename ReplacementPointer > | |
void | Assign (const RegisteredFactory &key, ReplacementPointer &&replacement) |
Reassign Site's pointer to ClientData. More... | |
![]() | |
virtual | ~ChannelGroup () |
double | GetStartTime () const |
Get the minimum of Start() values of intervals, or 0 when none. More... | |
double | GetEndTime () const |
Get the maximum of End() values of intervals, or 0 when none. More... | |
void | ShiftBy (double t) |
Change start time by given duration. More... | |
virtual void | MoveTo (double o)=0 |
Change start time to given time point. More... | |
virtual bool | IsLeader () const =0 |
ChannelGroupData & | GetGroupData () |
Make attachment site on demand as needed. More... | |
const ChannelGroupData & | GetGroupData () const |
ChannelGroupData * | FindGroupData () |
Do not make attachment site on demand if absent. More... | |
const ChannelGroupData * | FindGroupData () const |
Do not make attachment site on demand if absent. More... | |
void | Init (const ChannelGroup &other) |
Copy, including cloning of attached objects. More... | |
void | DestroyGroupData () |
Leave all attachments null. More... | |
std::unique_ptr< ChannelGroupData > | DetachGroupData () |
Move attachments out. More... | |
void | AssignGroupData (std::unique_ptr< ChannelGroupData > pGroupData) |
Replace any previous attachments. More... | |
virtual size_t | NChannels () const =0 |
Report the number of channels. More... | |
template<typename ChannelType = Channel> | |
std::shared_ptr< ChannelType > | GetChannel (size_t iChannel) |
Retrieve a channel, cast to the given type. More... | |
template<typename ChannelType = const Channel> | |
auto | GetChannel (size_t iChannel) const -> std::enable_if_t< std::is_const_v< ChannelType >, std::shared_ptr< ChannelType > > |
template<typename ChannelType = Channel> | |
IteratorRange< ChannelIterator< ChannelType > > | Channels () |
Get range of channels with mutative access. More... | |
template<typename ChannelType = const Channel> | |
auto | Channels () const -> std::enable_if_t< std::is_const_v< ChannelType >, IteratorRange< ChannelIterator< ChannelType > > > |
Get range of channels with read-only access. More... | |
virtual size_t | NIntervals () const =0 |
Report the number of intervals. More... | |
template<typename IntervalType = Interval> | |
std::shared_ptr< IntervalType > | GetInterval (size_t iInterval) |
Retrieve an interval, cast to the given type. More... | |
template<typename IntervalType = const Interval> | |
auto | GetInterval (size_t iInterval) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > > |
template<typename IntervalType = Interval> | |
IteratorRange< IntervalIterator< IntervalType > > | Intervals () |
Get range of intervals with mutative access. More... | |
template<typename IntervalType = const Interval> | |
auto | Intervals () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< IntervalIterator< IntervalType > > > |
Get range of intervals with read-only access. More... | |
Static Public Member Functions | |
template<typename Subclass = Track> | |
static std::shared_ptr< Subclass > | SharedPointer (Track *pTrack) |
template<typename Subclass = const Track> | |
static std::shared_ptr< Subclass > | SharedPointer (const Track *pTrack) |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
static size_t | numFactories () |
How many static factories have been registered with this specialization of Site. More... | |
Protected Member Functions | |
void | SetLinkType (LinkType linkType, bool completeList=true) |
virtual void | DoOnProjectTempoChange (const std::optional< double > &oldTempo, double newTempo)=0 |
![]() | |
template<typename Function > | |
void | ForEach (const Function &function) |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
void | ForEach (const Function &function) const |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
ClientData * | FindIf (const Function &function) |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
template<typename Function > | |
const ClientData * | FindIf (const Function &function) const |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
void | BuildAll () |
For each RegisteredFactory, if the corresponding attachment is absent in this , build and store it. More... | |
![]() | |
virtual std::shared_ptr< Channel > | DoGetChannel (size_t iChannel)=0 |
Retrieve a channel. More... | |
virtual std::shared_ptr< Interval > | DoGetInterval (size_t iInterval)=0 |
Retrieve an interval. More... | |
Protected Attributes | |
std::weak_ptr< TrackList > | mList |
TrackNodePointer | mNode {} |
Holds iterator to self, so that TrackList::Find can be constant-time. More... | |
int | mIndex |
0-based position of this track in its TrackList More... | |
Private Member Functions | |
void | SetId (TrackId id) |
int | GetIndex () const |
void | SetIndex (int index) |
void | DoSetLinkType (LinkType linkType, bool completeList=true) |
Track * | GetLinkedTrack () const |
bool | HasLinkedTrack () const noexcept |
Returns true for leaders of multichannel groups. More... | |
TrackNodePointer | GetNode () const |
Retrieve mNode with debug checks. More... | |
void | SetOwner (const std::weak_ptr< TrackList > &list, TrackNodePointer node) |
Update mNode when Track is added to TrackList, or removed from it. More... | |
virtual TrackListHolder | Clone () const =0 |
Private Attributes | |
TrackId | mId |
Identifies the track only in-session, not persistently. More... | |
Friends | |
class | TrackList |
template<typename T > | |
std::enable_if_t< std::is_pointer_v< T >, T > | track_cast (Track *track) |
Encapsulate the checked down-casting of track pointers. More... | |
template<typename T > | |
std::enable_if_t< std::is_pointer_v< T > &&std::is_const_v< std::remove_pointer_t< T > >, T > | track_cast (const Track *track) |
Encapsulate the checked down-casting of track pointers. More... | |
Abstract base class for an object holding data associated with points on a time axis.
Fundamental data object of Audacity, displayed in the TrackPanel. Classes derived form it include the WaveTrack, NoteTrack, LabelTrack and TimeTrack.
using Track::Holder = std::shared_ptr<Track> |
Track::Track | ( | const Track & | orig, |
ProtectedCreationArg && | |||
) |
void Track::AdjustPositions | ( | ) |
Definition at line 1260 of file Track.cpp.
bool Track::Any | ( | ) | const |
Definition at line 285 of file Track.cpp.
Referenced by EffectLoudness::AllocBuffers(), TrackList::Channels_(), WaveTrack::DuplicateWithOtherTempo(), TrackList::EmptyRange(), ExportUtils::FindExportWaveTracks(), MakeTransportTracks(), anonymous_namespace{LabelMenus.cpp}::OnPasteNewLabel(), EffectNoiseReduction::Worker::Process(), and TrackList::Size().
|
static |
Definition at line 1206 of file Track.cpp.
References XO().
Referenced by AudioTrack::ClassTypeInfo(), and typeInfo().
|
pure virtual |
May assume precondition: t0 <= t1
IsLeader()
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by anonymous_namespace{LabelMenus.cpp}::OnDeleteLabels(), and SyncLockAdjust().
|
privatepure virtual |
Subclass responsibility implements only a part of Duplicate(), copying the track data proper (not associated data such as for groups and views)
unstretchInterval | If set, this time interval's stretching must be applied. |
!unstretchInterval.has_value() || unstretchInterval->first < unstretchInterval->second
IsLeader()
NChannels() == result->NChannels()
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by Duplicate(), and TrackList::RegisterPendingChangedTrack().
|
pure virtual |
Create new tracks and don't modify this track.
IsLeader
result->NChannels() == NChannels()
Implemented in TimeTrack, NoteTrack, WaveTrack, and LabelTrack.
|
pure virtual |
Create tracks and modify this track.
IsLeader()
result->NChannels() == NChannels()
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by SyncLockAdjust().
|
protectedpure virtual |
IsLeader()
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by OnProjectTempoChange().
|
private |
completeList | only influences debug build consistency checking |
Definition at line 174 of file Track.cpp.
References ChannelGroup::FindGroupData(), GetGroupData(), GetLinkedTrack(), GetLinkType(), HasLinkedTrack(), LinkConsistencyCheck(), ChannelGroup::ChannelGroupData::mLinkType, and ChannelGroup::None.
Referenced by SetLinkType().
|
virtual |
public nonvirtual duplication function that invokes Clone()
IsLeader()
NChannels() == result->NChannels()
Definition at line 86 of file Track.cpp.
References TrackList::Channels(), Clone(), GetOwner(), and IsLeader().
Referenced by WaveTrack::DuplicateWithOtherTempo(), and WaveTrack::MonoToStereo().
|
virtual |
Returns nonempty if an error was encountered while trying to open the track from XML
May assume consistency of stereo channel grouping and examine other channels
IsLeader()
Reimplemented in WaveTrack.
Definition at line 252 of file Track.cpp.
ChannelGroup::ChannelGroupData & Track::GetGroupData | ( | ) |
Definition at line 159 of file Track.cpp.
References GetHolder().
Referenced by DoSetLinkType(), SpectrogramSettings::Get(), WaveformSettings::Get(), WaveformScale::Get(), anonymous_namespace{PlayableTrack.cpp}::MuteAndSolo::Get(), anonymous_namespace{WaveChannelView.cpp}::PlacementArray::Get(), anonymous_namespace{WaveTrack.cpp}::WaveTrackData::Get(), SpectrogramBounds::Get(), GetGroupData(), GetName(), GetProjectTempo(), GetSelected(), OnProjectTempoChange(), SpectrogramSettings::Own(), SpectrogramSettings::Reset(), WaveformSettings::Set(), SetName(), and SetSelected().
const ChannelGroup::ChannelGroupData & Track::GetGroupData | ( | ) | const |
May make group data on demand, but consider that logically const.
Definition at line 169 of file Track.cpp.
References GetGroupData().
|
inline |
Definition at line 1462 of file Track.h.
References mNode.
Referenced by SpectrumView::DoDraw(), WaveformView::DoDraw(), GetGroupData(), and WaveTrack::ReallyDoGetChannelGroup().
|
inline |
Definition at line 150 of file Track.h.
Referenced by TrackList::HasPendingTracks(), SetLinkType(), SubstituteOriginalTrack(), and SubstitutePendingChangedTrack().
|
private |
Definition at line 130 of file Track.cpp.
References mIndex.
Referenced by TrackList::RecalcPositions().
|
private |
Definition at line 220 of file Track.cpp.
References TrackList::getNext(), HasLinkedTrack(), and mNode.
Referenced by DoSetLinkType(), TrackList::GetPrev(), IsLeader(), and LinkConsistencyFix().
|
noexcept |
Definition at line 1280 of file Track.cpp.
References ChannelGroup::FindGroupData(), and ChannelGroup::None.
Referenced by DoSetLinkType(), ProjectFileManager::FixTracks(), WaveTrack::LinkConsistencyFix(), and WaveTrack::WriteOneXML().
const wxString & Track::GetName | ( | ) | const |
Name is always the same for all channels of a group.
Definition at line 56 of file Track.cpp.
References GetGroupData(), and ChannelGroup::ChannelGroupData::mName.
Referenced by ProjectFileManager::AddImportedTracks(), LabelDialog::AddLabels(), CompareAudioCommand::Apply(), CommonTrackInfo::CloseTitleDrawFunction(), TrackUtilities::DoMoveTrack(), TrackUtilities::DoRemoveTrack(), anonymous_namespace{TrackMenus.cpp}::DoSortTracks(), MixerBoard::GetMusicalInstrumentBitmap(), TimeTrack::Init(), WaveTrack::JoinOne(), WaveTrack::LinkConsistencyFix(), LinkConsistencyFix(), WaveTrack::MakeNewClipName(), TrackMenuTable::OnSetName(), anonymous_namespace{SpectrumView.cpp}::SpectrogramSettingsHandler::OnSpectrogramSettings(), WaveTrackMenuTable::OnSplitStereo(), WaveTrackMenuTable::OnSplitStereoMono(), WaveTrackMenuTable::OnSwapChannels(), EffectFindClipping::Process(), RateMenuTable::SetRate(), RealtimeEffectStateUI::UpdateTrackData(), and WriteCommonXMLAttributes().
|
private |
Retrieve mNode with debug checks.
Definition at line 115 of file Track.cpp.
Referenced by TrackList::GetNext(), TrackList::GetPrev(), TrackList::MoveDown(), and TrackList::MoveUp().
|
inline |
Definition at line 254 of file Track.h.
Referenced by WaveTrack::Append(), WaveTrack::Clone(), TrackShifter::CommonMayMigrateTo(), WaveTrack::DoGet(), Duplicate(), AdjustClipBorder::FindSnapPoints(), anonymous_namespace{SyncLock.cpp}::FindSyncLockGroup(), WaveTrack::GetClipInterfaces(), WaveTrack::GetEnvelopeAtTime(), WaveTrack::GetEnvelopeValues(), anonymous_namespace{TrackArt.cpp}::BeatsGridlinePainter::GetProject(), anonymous_namespace{TimeTrack.cpp}::GetRate(), SyncLock::Group(), WaveTrack::HasTrivialEnvelope(), SyncLock::IsSyncLockSelected(), WaveTrack::MonoToStereo(), WaveTrack::NChannels(), WaveTrack::PasteOne(), TrackList::ReplaceOne(), TrackList::SwapChannels(), and WaveTrack::WidestEffectiveFormat().
const std::optional< double > & Track::GetProjectTempo | ( | ) | const |
Definition at line 1369 of file Track.cpp.
References GetGroupData(), and ChannelGroup::ChannelGroupData::mProjectTempo.
Referenced by WaveTrack::ClearAndPaste(), WaveTrack::ClearAndPasteAtSameTempo(), WaveTrack::CreateClip(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), WaveTrack::InsertClip(), WaveTrack::PasteWaveTrack(), and WaveTrack::PasteWaveTrackAtSameTempo().
bool Track::GetSelected | ( | ) | const |
Selectedness is always the same for all channels of a group.
Definition at line 70 of file Track.cpp.
References GetGroupData(), and ChannelGroup::ChannelGroupData::mSelected.
Referenced by CommonTrackInfo::CloseTitleDrawFunction(), TrackArt::DrawBackgroundWithSelection(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), CommonTrackInfo::DrawCloseButton(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack(), EffectOutputTracks::EffectOutputTracks(), anonymous_namespace{PlayableTrackControls.cpp}::EffectsDrawFunction(), anonymous_namespace{ClipMenus.cpp}::FindClipBoundaries(), anonymous_namespace{ClipMenus.cpp}::FindClips(), SelectionState::HandleListSelection(), IsSelected(), SyncLock::IsSyncLockSelected(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), anonymous_namespace{PlayableTrackControls.cpp}::MuteOrSoloDrawFunction(), NavigationActions::Handler::OnToggle(), EffectRepeat::Process(), LabelTrack::SetSelected(), and WriteCommonXMLAttributes().
|
pure virtual |
Implemented in NoteTrack, SampleTrack, WritableSampleTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by SameKindAs().
|
inlinevirtual |
bool Track::HandleCommonXMLAttribute | ( | const std::string_view & | attr, |
const XMLAttributeValueView & | valueView | ||
) |
Definition at line 1235 of file Track.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::ForEach(), SetName(), SetSelected(), XMLAttributeValueView::ToWString(), and XMLAttributeValueView::TryGet().
Referenced by NoteTrack::HandleXMLTag(), TimeTrack::HandleXMLTag(), WaveTrack::HandleXMLTag(), and LabelTrack::HandleXMLTag().
|
privatenoexcept |
Returns true for leaders of multichannel groups.
Definition at line 246 of file Track.cpp.
References ChannelGroup::FindGroupData(), and ChannelGroup::None.
Referenced by DoSetLinkType(), GetLinkedTrack(), TrackList::GetNext(), TrackList::GetPrev(), IsLeader(), LinkConsistencyFix(), and TrackList::SwapChannels().
|
inline |
void Track::Init | ( | const Track & | orig | ) |
Definition at line 50 of file Track.cpp.
References ChannelGroup::Init(), and mId.
Referenced by TimeTrack::Init(), and WaveTrack::Init().
|
pure virtual |
May assume precondition: t0 <= t1
IsLeader()
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
|
overridevirtual |
Implements ChannelGroup.
Reimplemented in SampleTrack, WritableSampleTrack, and WaveTrack.
Definition at line 291 of file Track.cpp.
References GetLinkedTrack(), and HasLinkedTrack().
Referenced by TrackList::Any(), NoteTrack::Clear(), TimeTrack::Clear(), LabelTrack::Clear(), TimeTrack::Clone(), LabelTrack::Clone(), CoarseTrackShifter::CoarseTrackShifter(), TrackShifter::CommonMayMigrateTo(), NoteTrack::Cut(), TimeTrack::Cut(), LabelTrack::Cut(), DEFINE_ATTACHED_VIRTUAL(), NoteTrack::DoOnProjectTempoChange(), TimeTrack::DoOnProjectTempoChange(), LabelTrack::DoOnProjectTempoChange(), ProjectAudioManager::DoRecord(), TimeShiftHandle::DoSlideVertical(), Duplicate(), TrackList::Find(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), SelectionState::HandleListSelection(), ClipMoveState::Init(), TrackList::Insert(), NoteTrack::InsertSilence(), TimeTrack::InsertSilence(), LabelTrack::InsertSilence(), WaveTrack::IsLeader(), IsSelectedLeader(), LinkConsistencyFix(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{LabelMenus.cpp}::OnDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), NavigationActions::Handler::OnLastTrack(), OnProjectTempoChange(), anonymous_namespace{LabelMenus.cpp}::OnSilenceLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitCutLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitLabels(), NavigationActions::Handler::OnToggle(), NoteTrack::PasteInto(), TimeTrack::PasteInto(), LabelTrack::PasteInto(), TrackList::RegisterPendingChangedTrack(), TrackList::Remove(), TrackList::ReplaceOne(), SelectionState::SelectTrack(), SelectionState::SelectTrackLength(), Viewport::ShowTrack(), NoteTrack::Silence(), TimeTrack::Silence(), LabelTrack::Silence(), SyncLockAdjust(), LabelTrack::SyncLockAdjust(), TrackPanel::UpdateTrackVRuler(), and AddedAnalysisTrack::~AddedAnalysisTrack().
bool Track::IsSelected | ( | ) | const |
Definition at line 288 of file Track.cpp.
References GetSelected().
Referenced by ProjectAudioManager::ChooseExistingRecordingTracks(), anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), ExportUtils::FindExportWaveTracks(), IsSelectedLeader(), SyncLock::IsSelectedOrSyncLockSelected(), SyncLock::IsSyncLockSelected(), MakeTransportTracks(), SelectActions::Handler::OnSelectSyncLockSel(), and EffectTruncSilence::ProcessIndependently().
bool Track::IsSelectedLeader | ( | ) | const |
Definition at line 296 of file Track.cpp.
References IsLeader(), and IsSelected().
Referenced by TrackList::Selected().
|
inline |
Do the non-mutating part of consistency fix only and return status.
Definition at line 249 of file Track.h.
Referenced by DoSetLinkType().
|
virtual |
Check consistency of channel groups, and maybe fix it.
doFix | whether to make any changes to correct inconsistencies |
!doFix || IsLeader()
Reimplemented in WaveTrack.
Definition at line 299 of file Track.cpp.
References GetLinkedTrack(), GetName(), HasLinkedTrack(), IsLeader(), ChannelGroup::None, and SetLinkType().
Referenced by WaveTrack::LinkConsistencyFix().
void Track::Notify | ( | bool | allChannels, |
int | code = -1 |
||
) |
Definition at line 257 of file Track.cpp.
References mList, and SharedPointer().
Referenced by WaveTrack::SetGain(), PlayableTrack::SetMute(), SetName(), WaveTrack::SetPan(), and PlayableTrack::SetSolo().
void Track::OnProjectTempoChange | ( | double | newTempo | ) |
method to set project tempo on track
IsLeader()
Definition at line 1361 of file Track.cpp.
References DoOnProjectTempoChange(), GetGroupData(), IsLeader(), and ChannelGroup::ChannelGroupData::mProjectTempo.
Referenced by WaveTrack::DuplicateWithOtherTempo().
|
pure virtual |
Weak precondition allows overrides to replicate one channel into many.
IsLeader()
SameKindAs(src)
src.NChannels() == 1 || src.NChannels() == NChannels()
Implemented in NoteTrack, TimeTrack, LabelTrack, WaveTrack, and WaveTrack.
Referenced by Paste(), and SyncLockAdjust().
void Track::Paste | ( | double | t, |
const TrackList & | src | ||
) |
Non-virtual overload that passes the first track of a given list
IsLeader()
SameKindAs(**src.begin()).NChannels()
NChannels == (**src.begin()).NChannels()
Definition at line 264 of file Track.cpp.
References TrackList::begin(), and Paste().
|
pure virtual |
Find or create the destination track for a paste, maybe in a different project
IsLeader()
list | to which any newly created tracks are added; but left unchanged if an existing track is found in the project instead |
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected().
|
inline |
Definition at line 410 of file Track.h.
References GetTypeInfo().
Referenced by TrackShifter::CommonMayMigrateTo(), anonymous_namespace{TimeShiftHandle.cpp}::FindCorrespondence(), and anonymous_namespace{EditMenus.cpp}::FitsInto().
|
inlineprivate |
Definition at line 152 of file Track.h.
References id.
Referenced by TrackList::DoAddToHead().
|
private |
Definition at line 135 of file Track.cpp.
References mIndex.
Referenced by TrackList::RecalcPositions().
|
protected |
completeList | only influences debug build consistency checking |
Definition at line 140 of file Track.cpp.
References DoSetLinkType(), GetId(), mList, and mNode.
Referenced by WaveTrack::HandleXMLTag(), WaveTrack::LinkConsistencyFix(), and LinkConsistencyFix().
void Track::SetName | ( | const wxString & | n | ) |
Definition at line 61 of file Track.cpp.
References GetGroupData(), ChannelGroup::ChannelGroupData::mName, name, and Notify().
Referenced by SetTrackStatusCommand::ApplyInner(), TimeTrack::CleanState(), HandleCommonXMLAttribute(), anonymous_namespace{ImportMIDI.cpp}::ImportMIDI(), TimeTrack::Init(), ModifiedAnalysisTrack::ModifiedAnalysisTrack(), NoteTrack::NoteTrack(), and TrackMenuTable::OnSetName().
|
private |
Update mNode when Track is added to TrackList, or removed from it.
Definition at line 121 of file Track.cpp.
Referenced by TrackList::DoAddToHead(), TrackList::Permute(), and TrackList::SwapNodes().
|
virtual |
Reimplemented in LabelTrack.
Definition at line 75 of file Track.cpp.
References GetGroupData(), mList, and ChannelGroup::ChannelGroupData::mSelected.
Referenced by SetTrackStatusCommand::ApplyInner(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), HandleCommonXMLAttribute(), anonymous_namespace{LabelMenus.cpp}::OnPasteNewLabel(), SelectionState::SelectTrack(), and LabelTrack::SetSelected().
|
inline |
Definition at line 160 of file Track.h.
Referenced by SelectHandle::AdjustSelection(), SelectionState::ChangeSelectionOnShiftClick(), WaveTrack::CopyOne(), DEFINE_ATTACHED_VIRTUAL_OVERRIDE(), TimeShiftHandle::DoSlideVertical(), TimeShiftHandle::Drag(), TrackFocus::GetFocus(), SelectHandle::HandleCenterFrequencyClick(), ClipMoveState::Init(), SelectHandle::MoveSnappingFreqSelection(), Notify(), EffectStereoToMono::ProcessOne(), SelectionState::SelectTrack(), TrackFocus::Set(), TrackFocus::SetFocus(), SharedPointer(), RealtimeEffectPanel::ShowPanel(), SubstituteOriginalTrack(), and SubstitutePendingChangedTrack().
|
inline |
|
inlinestatic |
Definition at line 184 of file Track.h.
References SharedPointer().
|
inlinestatic |
Definition at line 180 of file Track.h.
References SharedPointer().
|
pure virtual |
IsLeader()
Implemented in WaveTrack, NoteTrack, TimeTrack, and LabelTrack.
std::shared_ptr< const Track > Track::SubstituteOriginalTrack | ( | ) | const |
Definition at line 1185 of file Track.cpp.
References PackedArray::end(), GetId(), id, mList, and SharedPointer().
Referenced by SyncLock::IsSyncLockSelected().
std::shared_ptr< Track > Track::SubstitutePendingChangedTrack | ( | ) |
Definition at line 1164 of file Track.cpp.
References PackedArray::end(), GetId(), mList, and SharedPointer().
Referenced by anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), TrackPanel::DrawTracks(), SubstitutePendingChangedTrack(), and ProjectFileIO::WriteXML().
std::shared_ptr< const Track > Track::SubstitutePendingChangedTrack | ( | ) | const |
Definition at line 1180 of file Track.cpp.
References SubstitutePendingChangedTrack().
|
virtual |
Whether this track type implements cut-copy-paste; by default, true.
Reimplemented in TimeTrack.
Definition at line 1213 of file Track.cpp.
Referenced by SelectActions::Handler::OnCursorTrackEnd(), SelectActions::Handler::OnCursorTrackStart(), anonymous_namespace{EditMenus.cpp}::OnCut(), SelectActions::Handler::OnSelectSyncLockSel(), and anonymous_namespace{EditMenus.cpp}::OnSplitCut().
|
virtual |
This can be used to adjust a sync-lock selected track when the selection is replaced by one of a different length.
IsLeader()
Reimplemented in WaveTrack, and LabelTrack.
Definition at line 269 of file Track.cpp.
References Clear(), Cut(), ChannelGroup::GetEndTime(), IsLeader(), ChannelGroup::NChannels(), and Paste().
|
inline |
Do a TypeSwitch on this track, among all subtypes enumerated up to the point of the call
Definition at line 418 of file Track.h.
Referenced by SetEnvelopeCommand::ApplyInner(), EffectAutoDuck::Init(), anonymous_namespace{LabelMenus.cpp}::OnCopyLabels(), anonymous_namespace{LabelMenus.cpp}::OnCutLabels(), anonymous_namespace{LabelMenus.cpp}::OnDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnDisjoinLabels(), anonymous_namespace{LabelMenus.cpp}::OnJoinLabels(), anonymous_namespace{EditMenus.cpp}::OnPaste(), anonymous_namespace{LabelMenus.cpp}::OnSilenceLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitCutLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitDeleteLabels(), anonymous_namespace{LabelMenus.cpp}::OnSplitLabels(), NoteTrack::Paste(), TimeTrack::Paste(), LabelTrack::Paste(), LabelTrack::PasteOver(), NyquistEffect::ProcessOne(), and StretchHandle::Stretch().
|
inline |
Do a TypeSwitch on this track, among all subtypes enumerated up to the point of the call
Definition at line 429 of file Track.h.
void Track::WriteCommonXMLAttributes | ( | XMLWriter & | xmlFile, |
bool | includeNameAndSelected = true |
||
) | const |
Definition at line 1219 of file Track.cpp.
References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::ForEach(), GetName(), GetSelected(), XMLWriter::WriteAttr(), and wxT().
Referenced by TimeTrack::WriteXML(), and LabelTrack::WriteXML().
|
pure virtual |
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
|
friend |
Encapsulate the checked down-casting of track pointers.
Eliminates possibility of error – and not quietly casting away const
Typical usage:
This overload for const pointers can cast only to other const pointer types.
Definition at line 622 of file Track.h.
|
friend |
Encapsulate the checked down-casting of track pointers.
Eliminates possibility of error – and not quietly casting away const
Typical usage:
Definition at line 605 of file Track.h.
|
private |
|
protected |
0-based position of this track in its TrackList
Definition at line 143 of file Track.h.
Referenced by GetIndex(), SetIndex(), and Track().
|
protected |
Back pointer to owning TrackList
Definition at line 139 of file Track.h.
Referenced by AdjustPositions(), GetNode(), TrackList::MakeMultiChannelTrack(), Notify(), SetLinkType(), SetOwner(), SetSelected(), SubstituteOriginalTrack(), SubstitutePendingChangedTrack(), and TrackList::UnlinkChannels().
|
protected |
Holds iterator to self, so that TrackList::Find can be constant-time.
mNode's pointer to std::list might not be this TrackList, if it's a pending update track
Definition at line 142 of file Track.h.
Referenced by AdjustPositions(), GetHolder(), GetLinkedTrack(), GetNode(), SetLinkType(), and SetOwner().