diff options
author | Carl Hetherington <carl@carlh.net> | 2010-08-20 23:58:49 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-08-20 23:58:49 +0000 |
commit | 067c4458a0ade1ae95f031c98a0ab7b3a349a74f (patch) | |
tree | 916369f82282c8881b67ee3b0d4235ea50ae8c0f /libs/ardour/diskstream.cc | |
parent | cdb3ade9ffb853c4c43f2d5d54f7d06bb2685480 (diff) |
Don't write undo records for automation that moves with regions when nothing changes about the automation.
git-svn-id: svn://localhost/ardour2/branches/3.0@7665 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/diskstream.cc')
-rw-r--r-- | libs/ardour/diskstream.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 064049049b..aaeb3c9270 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -466,9 +466,11 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const & for (uint32_t i = 0; i < p->npanners (); ++i) { boost::shared_ptr<AutomationList> pan_alist = p->streampanner(i).pan_control()->alist(); XMLNode & before = pan_alist->get_state (); - pan_alist->move_ranges (movements); - _session.add_command (new MementoCommand<AutomationList> ( - *pan_alist.get(), &before, &pan_alist->get_state ())); + bool const things_moved = pan_alist->move_ranges (movements); + if (things_moved) { + _session.add_command (new MementoCommand<AutomationList> ( + *pan_alist.get(), &before, &pan_alist->get_state ())); + } } } @@ -485,25 +487,23 @@ Diskstream::move_processor_automation (boost::weak_ptr<Processor> p, list< Evora } list< Evoral::RangeMove<double> > movements; - for (list< Evoral::RangeMove<framepos_t> >::const_iterator i = movements_frames.begin(); - i != movements_frames.end(); ++i) { + for (list< Evoral::RangeMove<framepos_t> >::const_iterator i = movements_frames.begin(); i != movements_frames.end(); ++i) { movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to)); } 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); - _session.add_command ( - new MementoCommand<AutomationList> ( - *al.get(), &before, &al->get_state () - ) - ); + bool const things_moved = al->move_ranges (movements); + if (things_moved) { + _session.add_command ( + new MementoCommand<AutomationList> ( + *al.get(), &before, &al->get_state () + ) + ); + } } } |