summaryrefslogtreecommitdiff
path: root/libs/ardour/session_rtevents.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-07-06 15:20:17 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-07-06 15:20:17 -0400
commitdb3223478c914f5b9ef97343ae2f262d3e99f74b (patch)
treec6296d880316399c05f36d7b571f4b04f54ea620 /libs/ardour/session_rtevents.cc
parentcf9706974c52f6116fcef9bfd02013e7b7150788 (diff)
quick checks on empty control lists, to avoid unnecessary work
Diffstat (limited to 'libs/ardour/session_rtevents.cc')
-rw-r--r--libs/ardour/session_rtevents.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc
index 8dba60f0e5..f1f99e3693 100644
--- a/libs/ardour/session_rtevents.cc
+++ b/libs/ardour/session_rtevents.cc
@@ -37,6 +37,10 @@ using namespace Glib;
void
Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllable::GroupControlDisposition gcd)
{
+ if (cl->empty()) {
+ return;
+ }
+
std::cerr << "Session::set_controls called on " << cl->size() << " controls, group = " << enum_2_string (gcd) << std::endl;
for (ControlList::iterator ci = cl->begin(); ci != cl->end(); ++ci) {
@@ -50,6 +54,10 @@ Session::set_controls (boost::shared_ptr<ControlList> cl, double val, Controllab
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);