}
}
-/** Set _bundles_connected to those bundles that are connected such that every
- * port on every bundle channel x is connected to port x in _ports.
- */
-void
-IO::check_bundles_connected ()
-{
- std::vector<UserBundleInfo*> new_list;
-
- for (std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin(); i != _bundles_connected.end(); ++i) {
-
- uint32_t const N = (*i)->bundle->nchannels().n_total();
-
- if (_ports.num_ports() < N) {
- continue;
- }
-
- bool ok = true;
-
- for (uint32_t j = 0; j < N; ++j) {
- /* Every port on bundle channel j must be connected to our input j */
- Bundle::PortList const pl = (*i)->bundle->channel_ports (j);
- for (uint32_t k = 0; k < pl.size(); ++k) {
- if (_ports.port(j)->connected_to (pl[k]) == false) {
- ok = false;
- break;
- }
- }
-
- if (ok == false) {
- break;
- }
- }
-
- if (ok) {
- new_list.push_back (*i);
- } else {
- delete *i;
- }
- }
-
- _bundles_connected = new_list;
-}
-
-
int
IO::disconnect (boost::shared_ptr<Port> our_port, string other_port, void* src)
{
error << string_compose(_("IO: cannot disconnect port %1 from %2"), our_port->name(), other_port) << endmsg;
return -1;
}
-
- check_bundles_connected ();
}
changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
}
_session.engine().unregister_port (port);
- check_bundles_connected ();
}
}
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
i->disconnect_all ();
}
-
- check_bundles_connected ();
}
changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
}
if (changed) {
- check_bundles_connected ();
PortCountChanged (n_ports()); /* EMIT SIGNAL */
_session.set_dirty ();
}
node->set_property("pretty-name", _pretty_name_prefix);
}
- for (std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin(); i != _bundles_connected.end(); ++i) {
- XMLNode* n = new XMLNode ("Bundle");
- n->set_property ("name", (*i)->bundle->name ());
- node->add_child_nocopy (*n);
- }
-
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
vector<string> connections;
c->connect (_bundle, _session.engine(), allow_partial);
- /* If this is a UserBundle, make a note of what we've done */
-
- boost::shared_ptr<UserBundle> ub = boost::dynamic_pointer_cast<UserBundle> (c);
- if (ub) {
-
- /* See if we already know about this one */
- std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin();
- while (i != _bundles_connected.end() && (*i)->bundle != ub) {
- ++i;
- }
-
- if (i == _bundles_connected.end()) {
- /* We don't, so make a note */
- _bundles_connected.push_back (new UserBundleInfo (this, ub));
- }
- }
}
changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
/* If this is a UserBundle, make a note of what we've done */
- boost::shared_ptr<UserBundle> ub = boost::dynamic_pointer_cast<UserBundle> (c);
- if (ub) {
-
- std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin();
- while (i != _bundles_connected.end() && (*i)->bundle != ub) {
- ++i;
- }
-
- if (i != _bundles_connected.end()) {
- delete *i;
- _bundles_connected.erase (i);
- }
- }
}
changed (IOChange (IOChange::ConnectionsChanged), src); /* EMIT SIGNAL */
{
BundleList bundles;
- /* User bundles */
- for (std::vector<UserBundleInfo*>::iterator i = _bundles_connected.begin(); i != _bundles_connected.end(); ++i) {
- bundles.push_back ((*i)->bundle);
- }
-
/* Session bundles */
boost::shared_ptr<ARDOUR::BundleList> b = _session.bundles ();
for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) {