summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-09-21 03:09:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-09-21 03:09:24 +0000
commita017411dfab6d85fdbdcb9d4fd17a05f0ee2cc2a (patch)
treef8da23d87eb1b94d5d02d10f332086e7eb01c345 /libs/ardour
parent5462d30076ad146cbdf2831db131011b7a0acc4f (diff)
missing part of lincoln's patch
git-svn-id: svn://localhost/ardour2/branches/3.0@7819 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/region_factory.h2
-rw-r--r--libs/ardour/audioregion.cc10
-rw-r--r--libs/ardour/playlist.cc8
-rw-r--r--libs/ardour/region_factory.cc7
4 files changed, 21 insertions, 6 deletions
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<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>,
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<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();
}
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<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;
}