Collect plugin runtime profile statistics.
[ardour.git] / libs / ardour / session_rtevents.cc
index 67249d48b9482d0f0751bf0f1c94512e578f2864..9e84d86a2392a5e52cc2e821351d3f0d43814b91 100644 (file)
@@ -25,8 +25,9 @@
 #include "ardour/route.h"
 #include "ardour/session.h"
 #include "ardour/track.h"
+#include "ardour/vca_manager.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace PBD;
@@ -36,13 +37,25 @@ using namespace Glib;
 void
 Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
 {
-       std::cerr << "Session::set_controls called on " << cl->size() << " controls, group = " << enum_2_string (gcd) << std::endl;
+       if (cl->empty()) {
+               return;
+       }
+
+       for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
+               /* as of july 2017 this is a no-op for everything except record enable */
+               (*ci)->pre_realtime_queue_stuff (val, gcd);
+       }
+
        queue_event (get_rt_event (cl, val, gcd));
 }
 
 void
 Session::set_control (boost::shared_ptr<AutomationControl> ac, double val, Controllable::GroupControlDisposition gcd)
 {
+       if (!ac) {
+               return;
+       }
+
        boost::shared_ptr<ControlList> cl (new ControlList);
        cl->push_back (ac);
        set_controls (cl, val, gcd);
@@ -51,9 +64,28 @@ Session::set_control (boost::shared_ptr<AutomationControl> ac, double val, Contr
 void
 Session::rt_set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
 {
+       /* Note that we require that all controls in the ControlList are of the
+          same type.
+       */
+       if (cl->empty()) {
+               return;
+       }
+
        for (ControlList::iterator c = cl->begin(); c != cl->end(); ++c) {
                (*c)->set_value (val, gcd);
        }
+
+       /* some controls need global work to take place after they are set. Do
+        * that here.
+        */
+
+       switch (cl->front()->parameter().type()) {
+       case SoloAutomation:
+               update_route_solo_state ();
+               break;
+       default:
+               break;
+       }
 }
 
 void
@@ -71,7 +103,10 @@ Session::rt_clear_all_solo_state (boost::shared_ptr<RouteList> rl, bool /* yn */
                }
                (*i)->clear_all_solo_state();
        }
-       set_dirty();
+
+       _vca_manager->clear_all_solo_state ();
+
+       update_route_solo_state ();
 }
 
 void