From 244313f43fc3178fb8f58b01fc6ba125115062ad Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 25 May 2017 14:10:14 +0200 Subject: Always create a deep copy of MIDI regions when copying playlists. --- libs/ardour/ardour/region_factory.h | 2 +- libs/ardour/playlist.cc | 2 +- libs/ardour/region_factory.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 4b32da0512..32c5e32c0f 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -59,7 +59,7 @@ public: static PBD::Signal1 > CheckNewRegion; /** create a "pure copy" of Region @param other */ - static boost::shared_ptr create (boost::shared_ptr other, bool announce = false); + static boost::shared_ptr create (boost::shared_ptr other, bool announce = false, bool fork = false); /** create a region from a single Source */ static boost::shared_ptr create (boost::shared_ptr, diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index b7ff71068b..094b682adb 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -291,7 +291,7 @@ Playlist::copy_regions (RegionList& newlist) const RegionReadLock rlock (const_cast (this)); for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { - newlist.push_back (RegionFactory::create (*i, true)); + newlist.push_back (RegionFactory::create (*i, true, true)); } } diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 78425db88c..c1f3ecf474 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -46,7 +46,7 @@ std::map RegionFactory::region_name_map; RegionFactory::CompoundAssociations RegionFactory::_compound_associations; boost::shared_ptr -RegionFactory::create (boost::shared_ptr region, bool announce) +RegionFactory::create (boost::shared_ptr region, bool announce, bool fork) { boost::shared_ptr ret; boost::shared_ptr ar; @@ -58,7 +58,7 @@ RegionFactory::create (boost::shared_ptr region, bool announce) } else if ((mr = boost::dynamic_pointer_cast(region)) != 0) { - if (mr->session().config.get_midi_copy_is_fork()) { + if (mr->session().config.get_midi_copy_is_fork() || fork) { /* What we really want to do here is what Editor::fork_region() does via Session::create_midi_source_by_stealing_name(), but we don't have a Track. We'll just live with the skipped number, -- cgit v1.2.3