mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 17:46:34 +01:00
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
This commit is contained in:
parent
cdb3ade9ff
commit
067c4458a0
3 changed files with 35 additions and 20 deletions
|
|
@ -466,9 +466,11 @@ Diskstream::playlist_ranges_moved (list< Evoral::RangeMove<framepos_t> > const &
|
||||||
for (uint32_t i = 0; i < p->npanners (); ++i) {
|
for (uint32_t i = 0; i < p->npanners (); ++i) {
|
||||||
boost::shared_ptr<AutomationList> pan_alist = p->streampanner(i).pan_control()->alist();
|
boost::shared_ptr<AutomationList> pan_alist = p->streampanner(i).pan_control()->alist();
|
||||||
XMLNode & before = pan_alist->get_state ();
|
XMLNode & before = pan_alist->get_state ();
|
||||||
pan_alist->move_ranges (movements);
|
bool const things_moved = pan_alist->move_ranges (movements);
|
||||||
_session.add_command (new MementoCommand<AutomationList> (
|
if (things_moved) {
|
||||||
*pan_alist.get(), &before, &pan_alist->get_state ()));
|
_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;
|
list< Evoral::RangeMove<double> > movements;
|
||||||
for (list< Evoral::RangeMove<framepos_t> >::const_iterator i = movements_frames.begin();
|
for (list< Evoral::RangeMove<framepos_t> >::const_iterator i = movements_frames.begin(); i != movements_frames.end(); ++i) {
|
||||||
i != movements_frames.end(); ++i) {
|
|
||||||
movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to));
|
movements.push_back(Evoral::RangeMove<double>(i->from, i->length, i->to));
|
||||||
}
|
}
|
||||||
|
|
||||||
set<Evoral::Parameter> const a = processor->what_can_be_automated ();
|
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) {
|
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();
|
boost::shared_ptr<AutomationList> al = processor->automation_control(*i)->alist();
|
||||||
XMLNode & before = al->get_state ();
|
XMLNode & before = al->get_state ();
|
||||||
al->move_ranges (movements);
|
bool const things_moved = al->move_ranges (movements);
|
||||||
_session.add_command (
|
if (things_moved) {
|
||||||
new MementoCommand<AutomationList> (
|
_session.add_command (
|
||||||
*al.get(), &before, &al->get_state ()
|
new MementoCommand<AutomationList> (
|
||||||
)
|
*al.get(), &before, &al->get_state ()
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ public:
|
||||||
void erase_range (double start, double end);
|
void erase_range (double start, double end);
|
||||||
void erase (iterator);
|
void erase (iterator);
|
||||||
void erase (iterator, iterator);
|
void erase (iterator, iterator);
|
||||||
void move_ranges (std::list< RangeMove<double> > const &);
|
bool move_ranges (std::list< RangeMove<double> > const &);
|
||||||
void modify (iterator, double, double);
|
void modify (iterator, double, double);
|
||||||
|
|
||||||
boost::shared_ptr<ControlList> cut (double, double);
|
boost::shared_ptr<ControlList> cut (double, double);
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,9 @@ ControlList::erase_range_internal (double start, double endt, EventList & events
|
||||||
cp.when = endt;
|
cp.when = endt;
|
||||||
e = upper_bound (events.begin(), events.end(), &cp, time_comparator);
|
e = upper_bound (events.begin(), events.end(), &cp, time_comparator);
|
||||||
events.erase (s, e);
|
events.erase (s, e);
|
||||||
erased = true;
|
if (s != e) {
|
||||||
|
erased = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return erased;
|
return erased;
|
||||||
|
|
@ -1354,8 +1356,10 @@ ControlList::paste (ControlList& alist, double pos, float /*times*/)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move automation around according to a list of region movements */
|
/** Move automation around according to a list of region movements.
|
||||||
void
|
* @param return true if anything was changed, otherwise false (ie nothing needed changing)
|
||||||
|
*/
|
||||||
|
bool
|
||||||
ControlList::move_ranges (const list< RangeMove<double> >& movements)
|
ControlList::move_ranges (const list< RangeMove<double> >& movements)
|
||||||
{
|
{
|
||||||
typedef list< RangeMove<double> > RangeMoveList;
|
typedef list< RangeMove<double> > RangeMoveList;
|
||||||
|
|
@ -1367,11 +1371,21 @@ ControlList::move_ranges (const list< RangeMove<double> >& movements)
|
||||||
EventList old_events = _events;
|
EventList old_events = _events;
|
||||||
|
|
||||||
/* clear the source and destination ranges in the new list */
|
/* clear the source and destination ranges in the new list */
|
||||||
|
bool things_erased = false;
|
||||||
for (RangeMoveList::const_iterator i = movements.begin (); i != movements.end (); ++i) {
|
for (RangeMoveList::const_iterator i = movements.begin (); i != movements.end (); ++i) {
|
||||||
|
|
||||||
erase_range_internal (i->from, i->from + i->length, _events);
|
if (erase_range_internal (i->from, i->from + i->length, _events)) {
|
||||||
erase_range_internal (i->to, i->to + i->length, _events);
|
things_erased = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (erase_range_internal (i->to, i->to + i->length, _events)) {
|
||||||
|
things_erased = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if nothing was erased, there is nothing to do */
|
||||||
|
if (!things_erased) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy the events into the new list */
|
/* copy the events into the new list */
|
||||||
|
|
@ -1399,6 +1413,7 @@ ControlList::move_ranges (const list< RangeMove<double> >& movements)
|
||||||
}
|
}
|
||||||
|
|
||||||
maybe_signal_changed ();
|
maybe_signal_changed ();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue