consolidate BundleAdded/Remove signal
authorRobin Gareus <robin@gareus.org>
Sun, 8 Mar 2015 21:38:55 +0000 (22:38 +0100)
committerRobin Gareus <robin@gareus.org>
Sun, 8 Mar 2015 21:38:55 +0000 (22:38 +0100)
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
libs/ardour/session.cc

index 50c4c229ea20a32f1613bafadc7e7bef0a317e39..7d2908a18c29ab87a541cdea4ccedd246f5a3a87 100644 (file)
@@ -716,12 +716,11 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        /* I/O bundles */
 
-       void add_bundle (boost::shared_ptr<Bundle>);
+       void add_bundle (boost::shared_ptr<Bundle>, bool emit_signal = true);
        void remove_bundle (boost::shared_ptr<Bundle>);
        boost::shared_ptr<Bundle> bundle_by_name (std::string) const;
 
-       PBD::Signal1<void,boost::shared_ptr<Bundle> > BundleAdded;
-       PBD::Signal1<void,boost::shared_ptr<Bundle> > BundleRemoved;
+       PBD::Signal0<void> BundleAddedOrRemoved;
 
        void midi_panic ();
 
index b18b756e60540b9fbe7643116e0233e25a259d71..97346e44e7e47bb9b00dd0faa32928a7b3ee01b2 100644 (file)
@@ -4129,7 +4129,7 @@ Session::available_capture_duration ()
 }
 
 void
-Session::add_bundle (boost::shared_ptr<Bundle> bundle)
+Session::add_bundle (boost::shared_ptr<Bundle> bundle, bool emit_signal)
 {
        {
                RCUWriter<BundleList> writer (_bundles);
@@ -4137,7 +4137,9 @@ Session::add_bundle (boost::shared_ptr<Bundle> 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> bundle)
        }
 
        if (removed) {
-                BundleRemoved (bundle); /* EMIT SIGNAL */
+                BundleAddedOrRemoved (); /* EMIT SIGNAL */
        }
 
        set_dirty();