summaryrefslogtreecommitdiff
path: root/libs/ardour/bundle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/bundle.cc')
-rw-r--r--libs/ardour/bundle.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 4f2198fd41..f409e0beee 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -466,3 +466,26 @@ Bundle::set_name (string const & n)
_name = n;
emit_changed (NameChanged);
}
+
+/** @param b Other bundle.
+ * @return true if b has the same number of channels as this bundle, and those channels have corresponding ports.
+ */
+bool
+Bundle::has_same_ports (boost::shared_ptr<Bundle> b) const
+{
+ uint32_t const N = nchannels ();
+
+ if (b->nchannels() != N) {
+ return false;
+ }
+
+ /* XXX: probably should sort channel port lists before comparing them */
+
+ for (uint32_t i = 0; i < N; ++i) {
+ if (channel_ports (i) != b->channel_ports (i)) {
+ return false;
+ }
+ }
+
+ return true;
+}