semantically more correct ordering of previous commit
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 10 Jun 2017 16:04:27 +0000 (12:04 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 10 Jun 2017 16:04:27 +0000 (12:04 -0400)
libs/ardour/control_protocol_manager.cc

index 7205b3e79e18368b429b8b62e814a729263ee56c..861684846754db21c62bf9e8bc83ae8f8d840fc8 100644 (file)
@@ -87,27 +87,11 @@ ControlProtocolManager::set_session (Session* s)
 {
        SessionHandlePtr::set_session (s);
 
-       if (_session) {
-
-               /* get selection info and set it before instantiating any
-                * control protocols.
-                */
-
-               CoreSelection::StripableAutomationControls sac;
-               _session->selection().get_stripables (sac);
-
-               if (!sac.empty()) {
-                       StripableNotificationListPtr v (new StripableNotificationList);
-                       for (CoreSelection::StripableAutomationControls::iterator i = sac.begin(); i != sac.end(); ++i) {
-                               if ((*i).stripable) {
-                                       v->push_back (boost::weak_ptr<Stripable> ((*i).stripable));
-                               }
-                       }
-                       if (!v->empty()) {
-                               StripableSelectionChanged (v); /* EMIT SIGNAL */
-                       }
-               }
+       if (!_session) {
+               return;
+       }
 
+       {
                Glib::Threads::RWLock::ReaderLock lm (protocols_lock);
 
                for (list<ControlProtocolInfo*>::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) {
@@ -116,6 +100,21 @@ ControlProtocolManager::set_session (Session* s)
                        }
                }
        }
+
+       CoreSelection::StripableAutomationControls sac;
+       _session->selection().get_stripables (sac);
+
+       if (!sac.empty()) {
+               StripableNotificationListPtr v (new StripableNotificationList);
+               for (CoreSelection::StripableAutomationControls::iterator i = sac.begin(); i != sac.end(); ++i) {
+                       if ((*i).stripable) {
+                               v->push_back (boost::weak_ptr<Stripable> ((*i).stripable));
+                       }
+               }
+               if (!v->empty()) {
+                       StripableSelectionChanged (v); /* EMIT SIGNAL */
+               }
+       }
 }
 
 int