X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fselection.cc;h=2286c8375174e2129c3bd571d7f4d19247332245;hb=bcbdd858faff38b9b22573284f07bdb35b76140b;hp=876056c3da81a7b55cfb3cebc46f7ffe859f1b86;hpb=e8e68fd8c64585f01b9c04bfb1f1a648586063ef;p=ardour.git diff --git a/libs/ardour/selection.cc b/libs/ardour/selection.cc index 876056c3da..2286c83751 100644 --- a/libs/ardour/selection.cc +++ b/libs/ardour/selection.cc @@ -217,9 +217,11 @@ CoreSelection::get_stripables (StripableAutomationControls& sc) const boost::shared_ptr c; if (!s) { + /* some global automation control, not owned by a Stripable */ c = session.automation_control_by_id ((*x).controllable); } else { - c = s->automation_control ((*x).controllable); + /* automation control owned by a Stripable or one of its children */ + c = s->automation_control_recurse ((*x).controllable); } if (s || c) { @@ -249,10 +251,14 @@ CoreSelection::remove_stripable_by_id (PBD::ID const & id) { Glib::Threads::RWLock::WriterLock lm (_lock); - for (SelectedStripables::iterator x = _stripables.begin(); x != _stripables.end(); ++x) { + for (SelectedStripables::iterator x = _stripables.begin(); x != _stripables.end(); ) { if ((*x).stripable == id) { - _stripables.erase (x); - return; + _stripables.erase (x++); + /* keep going because there may be more than 1 pair of + stripable/automation-control in the selection. + */ + } else { + ++x; } } }