22 if (pTrack->GetId() ==
TrackId{})
25 mpTracks->
Add(pTrack->Duplicate());
31 for (
auto pTrack : *mpTracks)
32 dstTracks.Add(pTrack->Duplicate());
42 return std::make_shared<TrackListRestorer>(
project);
51 iter = std::find_if(
exts.begin(),
end, [](
auto &pExt){
52 return dynamic_cast<TrackListRestorer*>(pExt.get());
55 return static_cast<TrackListRestorer*
>(iter->get())->mpTracks.get();
declares abstract base class Track, TrackList, and iterators over TrackList
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
bool HasPendingTracks() const
static PendingTracks & Get(AudacityProject &project)
An in-session identifier of track objects across undo states. It does not persist between sessions.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
static TrackList & Get(AudacityProject &project)
TrackKind * Add(const std::shared_ptr< TrackKind > &t, bool assignIds=true)
Base class for extra information attached to undo/redo states.
TRACK_API TrackList * Find(const UndoStackElem &state)
UndoRedoExtensionRegistry::Entry sEntry
const char * end(const char *str) noexcept
Typically statically constructed.
Holds one item with description and time range for the UndoManager.
bool CanUndoOrRedo(const AudacityProject &project) override
Whether undo or redo is now permitted; default returns true.
void RestoreUndoRedoState(AudacityProject &project) override
Modify the project when undoing or redoing to some state in history.
TrackListRestorer(AudacityProject &project)
const std::shared_ptr< TrackList > mpTracks