make Selection catch up with session/libardour-side selection status at session load
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 2 Jul 2016 20:09:19 +0000 (16:09 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 2 Jul 2016 20:09:19 +0000 (16:09 -0400)
gtk2_ardour/editor.cc

index fe274248449048e569642a1e791df411f4a8c1df..3ee542b06afeb673f66e1325123861e555b0cbbd 100644 (file)
@@ -1422,6 +1422,25 @@ Editor::set_session (Session *t)
                break;
        }
 
+       /* catch up on selection of stripables (other selection state is lost
+        * when a session is closed
+        */
+
+       StripableList sl;
+       TrackViewList tl;
+       _session->get_stripables (sl);
+       for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
+               if ((*s)->presentation_info().selected()) {
+                       RouteTimeAxisView* rtav = get_route_view_by_route_id ((*s)->id());
+                       if (rtav) {
+                               tl.push_back (rtav);
+                       }
+               }
+       }
+       if (!tl.empty()) {
+               selection->set (tl);
+       }
+
        /* register for undo history */
        _session->register_with_memento_command_factory(id(), this);
        _session->register_with_memento_command_factory(_selection_memento->id(), _selection_memento);