From 092e598389668135b9ff1ae493213b17aa2070d7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 Jul 2010 01:22:33 +0000 Subject: 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 --- libs/ardour/diskstream.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'libs/ardour/diskstream.cc') 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->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->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 > const & movements_frames) +Diskstream::playlist_ranges_moved (list< Evoral::RangeMove > 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 p, list< Evora set const a = processor->what_can_be_automated (); + cout << "move processor auto for " << processor->name() << "\n"; + for (set::iterator i = a.begin (); i != a.end (); ++i) { + cout << "moving " << *i << "\n"; boost::shared_ptr al = processor->automation_control(*i)->alist(); XMLNode & before = al->get_state (); al->move_ranges (movements); -- cgit v1.2.3