mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-07 06:55:52 +01:00
Define virtual Track::PasteInto to simplfy Paste...
... Also making EditMenus not dependent on TimeTrack
This commit is contained in:
@@ -136,6 +136,18 @@ bool TimeTrack::SupportsBasicEditing() const
|
||||
return false;
|
||||
}
|
||||
|
||||
Track::Holder TimeTrack::PasteInto( AudacityProject &project ) const
|
||||
{
|
||||
// Maintain uniqueness of the time track!
|
||||
std::shared_ptr<TimeTrack> pNewTrack;
|
||||
if( auto pTrack = *TrackList::Get( project ).Any<TimeTrack>().begin() )
|
||||
pNewTrack = pTrack->SharedPointer<TimeTrack>();
|
||||
else
|
||||
pNewTrack = std::make_shared<TimeTrack>( &ViewInfo::Get( project ) );
|
||||
pNewTrack->Paste(0.0, this);
|
||||
return pNewTrack;
|
||||
}
|
||||
|
||||
Track::Holder TimeTrack::Cut( double t0, double t1 )
|
||||
{
|
||||
auto result = Copy( t0, t1, false );
|
||||
|
||||
Reference in New Issue
Block a user