X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Fregion_factory.cc;h=c1f3ecf47428cb42e6fe5c5a5dff95a3e7718260;hb=79abf3dfa6d649fbf1fb6fd16cd489f434d0b909;hp=6578e89837c2346c91049b8af6985d428457b7c0;hpb=140258d8abc366ddd600a7b3079b55a730b10225;p=ardour.git diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 6578e89837..c1f3ecf474 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -30,7 +30,7 @@ #include "ardour/region_factory.h" #include "ardour/session.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace PBD; @@ -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, const int32_t sub_num) +RegionFactory::create (boost::shared_ptr region, bool announce, bool fork) { boost::shared_ptr ret; boost::shared_ptr ar; @@ -54,11 +54,11 @@ RegionFactory::create (boost::shared_ptr region, bool announce, co if ((ar = boost::dynamic_pointer_cast(region)) != 0) { - ret = boost::shared_ptr (new AudioRegion (ar, 0, sub_num)); + ret = boost::shared_ptr (new AudioRegion (ar, MusicFrame (0, 0))); } 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, @@ -71,7 +71,7 @@ RegionFactory::create (boost::shared_ptr region, bool announce, co source->set_ancestor_name(mr->sources().front()->name()); ret = mr->clone(source); } else { - ret = boost::shared_ptr (new MidiRegion (mr, 0, sub_num)); + ret = boost::shared_ptr (new MidiRegion (mr, MusicFrame (0, 0))); } } else { @@ -87,8 +87,6 @@ RegionFactory::create (boost::shared_ptr region, bool announce, co ret->set_position_lock_style (MusicTime); } - ret->set_position (region->position(), sub_num); - /* pure copy constructor - no property list */ if (announce) { map_add (ret); @@ -144,7 +142,7 @@ RegionFactory::create (boost::shared_ptr region, const PropertyList& pli } boost::shared_ptr -RegionFactory::create (boost::shared_ptr region, frameoffset_t offset, const PropertyList& plist, bool announce, const int32_t sub_num) +RegionFactory::create (boost::shared_ptr region, MusicFrame offset, const PropertyList& plist, bool announce) { boost::shared_ptr ret; boost::shared_ptr other_a; @@ -152,11 +150,11 @@ RegionFactory::create (boost::shared_ptr region, frameoffset_t offset, c if ((other_a = boost::dynamic_pointer_cast(region)) != 0) { - ret = boost::shared_ptr (new AudioRegion (other_a, offset, sub_num)); + ret = boost::shared_ptr (new AudioRegion (other_a, offset)); } else if ((other_m = boost::dynamic_pointer_cast(region)) != 0) { - ret = boost::shared_ptr (new MidiRegion (other_m, offset, sub_num)); + ret = boost::shared_ptr (new MidiRegion (other_m, offset)); } else { fatal << _("programming error: RegionFactory::create() called with unknown Region type")