diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-08 10:36:46 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-08 10:41:12 +0100 |
commit | 7d523dc43c78a6cbdd2668cb541f186f7ae8bdeb (patch) | |
tree | d30220ec3066255f05d14e26d5de92af6f93c7dd | |
parent | 24b8004bf74884e5fc4f6c376ba782402712ab49 (diff) |
when removing a Route from Session, remove it from CoreSelection and signal that change if necessary
-rw-r--r-- | libs/ardour/session.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 3cf24ba581..2d4f11b1dc 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3719,6 +3719,7 @@ void Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove) { bool mute_changed = false; + bool send_selected = false; { // RCU Writer scope PBD::Unwinder<bool> uw_flag (_route_deletion_in_progress, true); @@ -3727,6 +3728,10 @@ Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove) for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) { + if (_selection->selected (*iter)) { + send_selected = true; + } + if (*iter == _master_out) { continue; } @@ -3824,19 +3829,27 @@ Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove) * and unregister ports from the backend */ + if (send_selected && !deletion_in_progress()) { + for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) { + _selection->remove_stripable_by_id ((*iter)->id()); + } + PropertyChange so; + so.add (Properties::order); + if (send_selected) { + so.add (Properties::selected); + } + PresentationInfo::Change (so); + } + for (RouteList::iterator iter = routes_to_remove->begin(); iter != routes_to_remove->end(); ++iter) { cerr << "Drop references to " << (*iter)->name() << endl; (*iter)->drop_references (); } - if (_state_of_the_state & Deletion) { + if (deletion_in_progress()) { return; } - PropertyChange so; - so.add (Properties::selected); - so.add (Properties::order); - PresentationInfo::Change (PropertyChange (so)); /* save the new state of the world */ |