Paste Mode: overwrite-paste, naive implementation using rec-mode (for testing)

This commit is contained in:
Ben Loftis 2021-06-06 08:43:55 -05:00
parent 7cc92d8f27
commit f4d4dddbeb
2 changed files with 10 additions and 1 deletions

View File

@ -2621,7 +2621,7 @@ Editor::insert_source_list_selection (float times)
begin_reversible_command (_("insert region"));
playlist->clear_changes ();
playlist->clear_owned_changes ();
playlist->add_region ((RegionFactory::create (region, true)), get_preferred_edit_position(), times);
playlist->add_region ((RegionFactory::create (region, true)), get_preferred_edit_position(), times, _session->config.get_layered_record_mode()); //ToDo: insert_mode ?
if (Config->get_edit_mode() == Ripple) {
playlist->ripple (get_preferred_edit_position(), region->length() * times, boost::shared_ptr<Region>());
/* recusive diff of rippled regions */

View File

@ -1296,6 +1296,15 @@ Playlist::paste (boost::shared_ptr<Playlist> other, samplepos_t position, float
{
times = fabs (times);
if (times==1 && _session.config.get_layered_record_mode()) { //ToDo: insert_mode?
RegionWriteLock rlock (this);
samplepos_t pos = position;
partition_internal (pos - 1, (pos + other->_get_extent ().second), true, rlock.thawlist);
for (RegionList::iterator i = rlock.thawlist.begin (); i != rlock.thawlist.end (); ++i) {
_session.add_command (new StatefulDiffCommand (*i));
}
}
{
RegionReadLock rl2 (other.get ());