13
0

missing part of lincoln's patch

git-svn-id: svn://localhost/ardour2/branches/3.0@7819 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-09-21 03:09:24 +00:00
parent 5462d30076
commit a017411dfa
4 changed files with 21 additions and 6 deletions

View File

@ -56,7 +56,7 @@ class RegionFactory {
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);
static boost::shared_ptr<Region> create (boost::shared_ptr<const Region> other, bool announce = false);
/** create a region from a single Source */
static boost::shared_ptr<Region> create (boost::shared_ptr<Source>,

View File

@ -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

View File

@ -324,7 +324,7 @@ Playlist::copy_regions (RegionList& newlist) const
RegionLock rlock (const_cast<Playlist *> (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> region, framepos_t position, flo
*/
for (int i = 0; i < itimes; ++i) {
boost::shared_ptr<Region> copy = RegionFactory::create (region);
boost::shared_ptr<Region> copy = RegionFactory::create (region, true);
add_region_internal (copy, pos);
pos += region->length();
}
@ -1247,7 +1247,7 @@ Playlist::paste (boost::shared_ptr<Playlist> other, framepos_t position, float t
while (itimes--) {
for (RegionList::iterator i = other->regions.begin(); i != other->regions.end(); ++i) {
boost::shared_ptr<Region> copy_of_region = RegionFactory::create (*i);
boost::shared_ptr<Region> 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> region, framepos_t position, floa
framepos_t pos = position + 1;
while (itimes--) {
boost::shared_ptr<Region> copy = RegionFactory::create (region);
boost::shared_ptr<Region> copy = RegionFactory::create (region, true);
add_region_internal (copy, pos);
pos += region->length();
}

View File

@ -45,7 +45,7 @@ Glib::StaticMutex RegionFactory::region_name_map_lock;
std::map<std::string, uint32_t> RegionFactory::region_name_map;
boost::shared_ptr<Region>
RegionFactory::create (boost::shared_ptr<const Region> region)
RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
{
boost::shared_ptr<Region> ret;
boost::shared_ptr<const AudioRegion> ar;
@ -72,12 +72,17 @@ RegionFactory::create (boost::shared_ptr<const Region> 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;
}