-void
-MackieControlProtocol::gui_track_selection_changed (ARDOUR::StripableNotificationListPtr rl, bool save_list)
-{
- _gui_track_selection_changed (rl.get(), save_list, true);
-}
-
-void
-MackieControlProtocol::_gui_track_selection_changed (ARDOUR::StripableNotificationList* rl, bool save_list, bool gui_selection_did_change)
-{
- /* We need to keep a list of the most recently selected routes around,
- but we are not allowed to keep shared_ptr<Stripable> unless we want to
- handle the complexities of route deletion. So instead, the GUI sends
- us a notification using weak_ptr<Stripable>, which we keep a copy
- of. For efficiency's sake, however, we convert the weak_ptr's into
- shared_ptr<Stripable> before passing them to however many surfaces (and
- thus strips) that we have.
- */
-
- StrongStripableNotificationList srl;
-
- for (ARDOUR::StripableNotificationList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
- boost::shared_ptr<ARDOUR::Stripable> r = (*i).lock();
- if (r) {
- srl.push_back (r);
- }
- }
-
- {
- Glib::Threads::Mutex::Lock lm (surfaces_lock);
-
- for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
- (*s)->gui_selection_changed (srl);
- }
- }
-
- if (save_list) {
- _last_selected_stripables = *rl;
- }
-
- if (gui_selection_did_change) {
-
- check_fader_automation_state ();
-
- /* note: this method is also called when we switch banks.
- * But ... we don't allow bank switching when in subview mode.
- *
- * so .. we only have to care about subview mode if the
- * GUI selection has changed.
- *
- * It is possible that first_selected_stripable() may return null if we
- * are no longer displaying/mapping that route. In that case,
- * we will exit subview mode. If first_selected_stripable() is
- * null, and subview mode is not None, then the first call to
- * set_subview_mode() will fail, and we will reset to None.
- */
-
- if (set_subview_mode (_subview_mode, first_selected_stripable())) {
- set_subview_mode (None, boost::shared_ptr<Stripable>());
- }
- }
-}
-