Always create a deep copy of MIDI regions when copying playlists.
authorRobin Gareus <robin@gareus.org>
Thu, 25 May 2017 12:10:14 +0000 (14:10 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 25 May 2017 12:10:14 +0000 (14:10 +0200)
libs/ardour/ardour/region_factory.h
libs/ardour/playlist.cc
libs/ardour/region_factory.cc

index 4b32da051268c74e3b9bc3ce669848be5b342582..32c5e32c0f65b74b35f9ea522a66cdc6137457dd 100644 (file)
@@ -59,7 +59,7 @@ public:
        static PBD::Signal1<void,boost::shared_ptr<Region> >  CheckNewRegion;
 
        /** create a "pure copy" of Region @param other */
-       static boost::shared_ptr<Region> create (boost::shared_ptr<const Region> other, bool announce = false);
+       static boost::shared_ptr<Region> create (boost::shared_ptr<const Region> other, bool announce = false, bool fork = false);
 
        /** create a region from a single Source */
        static boost::shared_ptr<Region> create (boost::shared_ptr<Source>,
index b7ff71068b30723badbde816953835937e215a6f..094b682adbd65760d9abb2221a0fd8b637083019 100644 (file)
@@ -291,7 +291,7 @@ Playlist::copy_regions (RegionList& newlist) const
        RegionReadLock rlock (const_cast<Playlist *> (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));
        }
 }
 
index 78425db88ccea27d44c28a124f1e219d4c319d19..c1f3ecf47428cb42e6fe5c5a5dff95a3e7718260 100644 (file)
@@ -46,7 +46,7 @@ std::map<std::string, PBD::ID>                RegionFactory::region_name_map;
 RegionFactory::CompoundAssociations           RegionFactory::_compound_associations;
 
 boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
+RegionFactory::create (boost::shared_ptr<const Region> region, bool announce, bool fork)
 {
        boost::shared_ptr<Region> ret;
        boost::shared_ptr<const AudioRegion> ar;
@@ -58,7 +58,7 @@ RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
 
        } else if ((mr = boost::dynamic_pointer_cast<const MidiRegion>(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,