X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fbundle.cc;h=f409e0beee4eb1493e9696a3f772a4564213539f;hb=9e0d03020ff47773f7d1c0414de1c74e6c9e0dac;hp=4f2198fd41c7500ae61df4695cc917cae2e77e3d;hpb=660fd702af13ace2d0399e47d5e9a644a6e3a8d7;p=ardour.git 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 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; +}