X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fselection.cc;h=3193b12b20d29dbf39acd5aca631db98be0828af;hb=6cc18cef4f87651d741e8a23d17bdcaa841bf5c0;hp=1c0e89fdf035b1ffae1271b29ae1512e90750164;hpb=4e08f5c169b73c11f775c994d413319f68fabc53;p=ardour.git diff --git a/libs/ardour/selection.cc b/libs/ardour/selection.cc index 1c0e89fdf0..3193b12b20 100644 --- a/libs/ardour/selection.cc +++ b/libs/ardour/selection.cc @@ -17,6 +17,8 @@ */ +#include + #include "pbd/compose.h" #include "pbd/signals.h" @@ -79,6 +81,13 @@ CoreSelection::add (boost::shared_ptr s, boost::shared_ptrPropertyChanged (pc); + } } } @@ -102,6 +111,13 @@ CoreSelection::remove (boost::shared_ptr s, boost::shared_ptrPropertyChanged (pc); + } } } @@ -123,20 +139,39 @@ CoreSelection::set (boost::shared_ptr s, boost::shared_ptrPropertyChanged (pc); + } } void CoreSelection::clear_stripables () { bool send = false; + std::vector > s; DEBUG_TRACE (DEBUG::Selection, "clearing s/c selection\n"); - { Glib::Threads::RWLock::WriterLock lm (_lock); if (!_stripables.empty()) { + + s.reserve (_stripables.size()); + + for (SelectedStripables::const_iterator x = _stripables.begin(); x != _stripables.end(); ++x) { + boost::shared_ptr sp = session.stripable_by_id ((*x).stripable); + if (sp) { + s.push_back (sp); + } + } + _stripables.clear (); + send = true; DEBUG_TRACE (DEBUG::Selection, "cleared s/c selection\n"); } @@ -144,6 +179,13 @@ CoreSelection::clear_stripables () if (send) { send_selection_change (); + + PropertyChange pc (Properties::selected); + + for (std::vector >::iterator ss = s.begin(); ss != s.end(); ++ss) { + (*ss)->PropertyChanged (pc); + } + } } @@ -217,9 +259,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) { @@ -325,4 +369,3 @@ CoreSelection::selected () const Glib::Threads::RWLock::ReaderLock lm (_lock); return _stripables.size(); } -