summaryrefslogtreecommitdiff
path: root/libs/ardour/diskstream.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-22 01:22:33 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-22 01:22:33 +0000
commit092e598389668135b9ff1ae493213b17aa2070d7 (patch)
tree8491879a44bb2db8db80cfd6894796c2a894c575 /libs/ardour/diskstream.cc
parent8b0e35cba44643cc8e5deb27e6f138b3425d0559 (diff)
When a region movement is undone, prevent the resulting movement from triggering the automation-follows-regions code. Fixes #3348.
git-svn-id: svn://localhost/ardour2/branches/3.0@7464 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/diskstream.cc')
-rw-r--r--libs/ardour/diskstream.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 5dd9a3b306..064049049b 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -363,7 +363,7 @@ Diskstream::use_playlist (boost::shared_ptr<Playlist> playlist)
_playlist->ContentsChanged.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_modified, this));
_playlist->DropReferences.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_deleted, this, boost::weak_ptr<Playlist>(_playlist)));
- _playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1));
+ _playlist->RangesMoved.connect_same_thread (playlist_connections, boost::bind (&Diskstream::playlist_ranges_moved, this, _1, _2));
}
/* don't do this if we've already asked for it *or* if we are setting up
@@ -436,8 +436,17 @@ Diskstream::set_name (const string& str)
}
void
-Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const & movements_frames)
+Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const & movements_frames, bool from_undo)
{
+ /* If we're coming from an undo, it will have handled
+ automation undo (it must, since automation-follows-regions
+ can lose automation data). Hence we can do nothing here.
+ */
+
+ if (from_undo) {
+ return;
+ }
+
if (!_track || Config->get_automation_follows_regions () == false) {
return;
}
@@ -483,7 +492,10 @@ Diskstream::move_processor_automation (boost::weak_ptr<Processor> p, list< Evora
set<Evoral::Parameter> const a = processor->what_can_be_automated ();
+ cout << "move processor auto for " << processor->name() << "\n";
+
for (set<Evoral::Parameter>::iterator i = a.begin (); i != a.end (); ++i) {
+ cout << "moving " << *i << "\n";
boost::shared_ptr<AutomationList> al = processor->automation_control(*i)->alist();
XMLNode & before = al->get_state ();
al->move_ranges (movements);