diff options
author | Carl Hetherington <carl@carlh.net> | 2009-11-10 03:16:57 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-11-10 03:16:57 +0000 |
commit | dbb0b9ca4f82ea8e3829cfeb009b9746c3d6f0dc (patch) | |
tree | 2419b9eb122cf19a28940ea115c2d9630d0a22cc /libs/ardour/bundle.cc | |
parent | da03bc931b4c82497fb4b02003804c18768c56b6 (diff) |
Various adjustments to user bundle handling, with the general aim of allowing the user to create meaningful bundles with respect to their sound card an outboard setup, and having those user bundles take priority over ardour-generated ones.
git-svn-id: svn://localhost/ardour2/branches/3.0@6050 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/bundle.cc')
-rw-r--r-- | libs/ardour/bundle.cc | 23 |
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; +} |