- List::const_iterator i = _groups.begin ();
- while (i != _groups.end() && (*i)->total_channels() == ChanCount::ZERO) {
- ++i;
- }
-
- return (i == _groups.end());
-}
-
-/** Take a bundle, and either return it, if it contains only ports of type \a t,
- * or return a new bundle with those ports from \a b which are of type \a t.
- * Note that t == NIL is taken to mean "all types".
- */
-boost::shared_ptr<Bundle>
-PortGroupList::bundle_for_type (boost::shared_ptr<Bundle> b, DataType t) const
-{
- /* We are asked for a bundle with all types, so that's easy */
- if (t == DataType::NIL) {
- return b;
- }
-
- if (b->nchannels().get(t) == b->nchannels().n_total()) {
- /* All channels on b are of the correct type, so just return b */
- return b;
- }
-
- /* We must build a new bundle */
- boost::shared_ptr<Bundle> n (new ARDOUR::Bundle (b->name(), b->ports_are_inputs()));
- for (uint32_t i = 0; i < b->nchannels().n_total(); ++i) {
- if (b->channel_type(i) == t) {
- n->add_channel (b->channel_name (i), t, b->channel_ports (i));
- }
- }
-
- return n;