From 058222135342d75a4995779cf695b613d5888a34 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 8 Mar 2015 22:38:55 +0100 Subject: [PATCH] consolidate BundleAdded/Remove signal The only user (matrix) does not care which bundles are added/removed. This simplification will make it a lot easier to keep bundles in sync with actual hardware ports. --- libs/ardour/ardour/session.h | 5 ++--- libs/ardour/session.cc | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 50c4c229ea..7d2908a18c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -716,12 +716,11 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /* I/O bundles */ - void add_bundle (boost::shared_ptr); + void add_bundle (boost::shared_ptr, bool emit_signal = true); void remove_bundle (boost::shared_ptr); boost::shared_ptr bundle_by_name (std::string) const; - PBD::Signal1 > BundleAdded; - PBD::Signal1 > BundleRemoved; + PBD::Signal0 BundleAddedOrRemoved; void midi_panic (); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b18b756e60..97346e44e7 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4129,7 +4129,7 @@ Session::available_capture_duration () } void -Session::add_bundle (boost::shared_ptr bundle) +Session::add_bundle (boost::shared_ptr bundle, bool emit_signal) { { RCUWriter writer (_bundles); @@ -4137,7 +4137,9 @@ Session::add_bundle (boost::shared_ptr bundle) b->push_back (bundle); } - BundleAdded (bundle); /* EMIT SIGNAL */ + if (emit_signal) { + BundleAddedOrRemoved (); /* EMIT SIGNAL */ + } set_dirty(); } @@ -4159,7 +4161,7 @@ Session::remove_bundle (boost::shared_ptr bundle) } if (removed) { - BundleRemoved (bundle); /* EMIT SIGNAL */ + BundleAddedOrRemoved (); /* EMIT SIGNAL */ } set_dirty();