1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Define virtual Track::PasteInto to simplfy Paste...

... Also making EditMenus not dependent on TimeTrack
This commit is contained in:
Paul Licameli
2021-01-29 00:25:33 -05:00
parent 8543d2dd30
commit 15313a27f7
10 changed files with 55 additions and 36 deletions

View File

@@ -321,6 +321,12 @@ class AUDACITY_DLL_API Track /* not final */
//! Whether this track type implements cut-copy-paste; by default, true
virtual bool SupportsBasicEditing() const;
using Holder = std::shared_ptr<Track>;
//! Find or create the destination track for a paste, maybe in a different project
/*! @return A smart pointer to the track; its `use_count()` can tell whether it is new */
virtual Holder PasteInto( AudacityProject & ) const = 0;
//! Report times on the track where important intervals begin and end, for UI to snap to
/*!
Some intervals may be empty, and no ordering of the intervals is assumed.
@@ -393,7 +399,6 @@ private:
void Init(const Track &orig);
using Holder = std::shared_ptr<Track>;
// public nonvirtual duplication function that invokes Clone():
virtual Holder Duplicate() const;