summaryrefslogtreecommitdiff
path: root/libs/ardour/bundle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-02-02 22:17:06 +0000
committerCarl Hetherington <carl@carlh.net>2009-02-02 22:17:06 +0000
commit54afc94e62b6397286d545744cea796f93f4b5f9 (patch)
tree589c5eedfb63e96da410801e1f8cc3d3d4c06cd1 /libs/ardour/bundle.cc
parent633629b2b1590b687a79990fe1fb0df35301e709 (diff)
Re-enable creation of stereo bundles for system IO, so that the mixer strip
connection menus for stereo tracks are populated again. Also enable disconnection via these menus. git-svn-id: svn://localhost/ardour2/branches/3.0@4481 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/bundle.cc')
-rw-r--r--libs/ardour/bundle.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 48c0ead6e6..abf0bd07f9 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -22,6 +22,7 @@
#include <pbd/failed_constructor.h>
#include <ardour/ardour.h>
#include <ardour/bundle.h>
+#include <ardour/audioengine.h>
#include <pbd/xml++.h>
#include "i18n.h"
@@ -243,3 +244,39 @@ Bundle::add_channels_from_bundle (boost::shared_ptr<Bundle> other)
}
}
}
+
+void
+Bundle::connect (boost::shared_ptr<Bundle> other, AudioEngine & engine)
+{
+ uint32_t const N = nchannels ();
+ assert (N == other->nchannels ());
+
+ for (uint32_t i = 0; i < N; ++i) {
+ Bundle::PortList const & our_ports = channel_ports (i);
+ Bundle::PortList const & other_ports = other->channel_ports (i);
+
+ for (Bundle::PortList::const_iterator j = our_ports.begin(); j != our_ports.end(); ++j) {
+ for (Bundle::PortList::const_iterator k = other_ports.begin(); k != other_ports.end(); ++k) {
+ engine.connect (*j, *k);
+ }
+ }
+ }
+}
+
+void
+Bundle::disconnect (boost::shared_ptr<Bundle> other, AudioEngine & engine)
+{
+ uint32_t const N = nchannels ();
+ assert (N == other->nchannels ());
+
+ for (uint32_t i = 0; i < N; ++i) {
+ Bundle::PortList const & our_ports = channel_ports (i);
+ Bundle::PortList const & other_ports = other->channel_ports (i);
+
+ for (Bundle::PortList::const_iterator j = our_ports.begin(); j != our_ports.end(); ++j) {
+ for (Bundle::PortList::const_iterator k = other_ports.begin(); k != other_ports.end(); ++k) {
+ engine.disconnect (*j, *k);
+ }
+ }
+ }
+}