diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 459699d810..e99b9c80df 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -56,7 +56,7 @@ class RegionFactory { static PBD::Signal1 > CheckNewRegion; /** create a "pure copy" of Region @param other */ - static boost::shared_ptr create (boost::shared_ptr other); + static boost::shared_ptr create (boost::shared_ptr other, bool announce = false); /** create a region from a single Source */ static boost::shared_ptr create (boost::shared_ptr, diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index afd4456cdd..e4c4b55a54 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -116,8 +116,10 @@ AudioRegion::init () { register_properties (); + suspend_property_changes(); set_default_fades (); set_default_envelope (); + resume_property_changes(); listen_to_my_curves (); connect_to_analysis_changed (); @@ -958,6 +960,8 @@ AudioRegion::recompute_at_end () _envelope->truncate_end (_length); _envelope->set_max_xval (_length); _envelope->thaw (); + + suspend_property_changes(); if (_left_of_split) { set_default_fade_out (); @@ -971,6 +975,8 @@ AudioRegion::recompute_at_end () _fade_in->extend_to (_length); send_change (PropertyChange (Properties::fade_in)); } + + resume_property_changes(); } void @@ -979,6 +985,8 @@ AudioRegion::recompute_at_start () /* as above, but the shift was from the front */ _envelope->truncate_start (_length); + + suspend_property_changes(); if (_right_of_split) { set_default_fade_in (); @@ -992,6 +1000,8 @@ AudioRegion::recompute_at_start () _fade_out->extend_to (_length); send_change (PropertyChange (Properties::fade_out)); } + + resume_property_changes(); } int diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 614c0f5e36..4dda4f5c52 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -324,7 +324,7 @@ Playlist::copy_regions (RegionList& newlist) const RegionLock rlock (const_cast (this)); for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { - newlist.push_back (RegionFactory::RegionFactory::create (*i)); + newlist.push_back (RegionFactory::RegionFactory::create (*i, true)); } } @@ -709,7 +709,7 @@ Playlist::add_region (boost::shared_ptr region, framepos_t position, flo */ for (int i = 0; i < itimes; ++i) { - boost::shared_ptr copy = RegionFactory::create (region); + boost::shared_ptr copy = RegionFactory::create (region, true); add_region_internal (copy, pos); pos += region->length(); } @@ -1247,7 +1247,7 @@ Playlist::paste (boost::shared_ptr other, framepos_t position, float t while (itimes--) { for (RegionList::iterator i = other->regions.begin(); i != other->regions.end(); ++i) { - boost::shared_ptr copy_of_region = RegionFactory::create (*i); + boost::shared_ptr copy_of_region = RegionFactory::create (*i, true); /* put these new regions on top of all existing ones, but preserve the ordering they had in the original playlist. @@ -1283,7 +1283,7 @@ Playlist::duplicate (boost::shared_ptr region, framepos_t position, floa framepos_t pos = position + 1; while (itimes--) { - boost::shared_ptr copy = RegionFactory::create (region); + boost::shared_ptr copy = RegionFactory::create (region, true); add_region_internal (copy, pos); pos += region->length(); } diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index d8e862573f..44615e2182 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -45,7 +45,7 @@ Glib::StaticMutex RegionFactory::region_name_map_lock; std::map RegionFactory::region_name_map; boost::shared_ptr -RegionFactory::create (boost::shared_ptr region) +RegionFactory::create (boost::shared_ptr region, bool announce) { boost::shared_ptr ret; boost::shared_ptr ar; @@ -72,12 +72,17 @@ RegionFactory::create (boost::shared_ptr region) } if (ret) { + ret->set_name (new_region_name(ret->name())); map_add (ret); /* pure copy constructor - no property list */ /* pure copy constructor - no CheckNewRegion emitted */ + if (announce) { + CheckNewRegion (ret); + } } + return ret; }