change input/output button context menus for mixer strip to be non-additive: when selecting a new IO bundle, disconnect from any existing connections before connecting to the new one (fixes #5087)

git-svn-id: svn://localhost/ardour2/branches/3.0@13308 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-10-18 16:15:11 +00:00
parent 3e59452fa0
commit 2d9ed69fe2
7 changed files with 20 additions and 26 deletions

View file

@ -94,7 +94,7 @@ class IO : public SessionObject, public Latent
int ensure_io (ChanCount cnt, bool clear, void *src);
int connect_ports_to_bundle (boost::shared_ptr<Bundle>, void *);
int connect_ports_to_bundle (boost::shared_ptr<Bundle>, bool exclusive, void *);
int disconnect_ports_from_bundle (boost::shared_ptr<Bundle>, void *);
BundleList bundles_connected ();

View file

@ -176,7 +176,7 @@ AudioTrack::deprecated_use_diskstream_connections ()
}
}
_input->connect_ports_to_bundle (c, this);
_input->connect_ports_to_bundle (c, true, this);
} else if ((prop = node.property ("inputs")) != 0) {
if (_input->set_ports (prop->value())) {

View file

@ -912,7 +912,7 @@ IO::make_connections (const XMLNode& node, int version, bool in)
if (prop) {
boost::shared_ptr<Bundle> b = find_possible_bundle (prop->value());
if (b) {
connect_ports_to_bundle (b, this);
connect_ports_to_bundle (b, true, this);
}
}
@ -1241,13 +1241,19 @@ IO::latency () const
}
int
IO::connect_ports_to_bundle (boost::shared_ptr<Bundle> c, void* src)
IO::connect_ports_to_bundle (boost::shared_ptr<Bundle> c, bool exclusive, void* src)
{
BLOCK_PROCESS_CALLBACK ();
{
Glib::Threads::Mutex::Lock lm2 (io_lock);
if (exclusive) {
for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
i->disconnect_all ();
}
}
c->connect (_bundle, _session.engine());
/* If this is a UserBundle, make a note of what we've done */

View file

@ -502,7 +502,7 @@ RouteGroup::make_subgroup (bool aux, Placement placement)
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
(*i)->output()->disconnect (this);
(*i)->output()->connect_ports_to_bundle (bundle, this);
(*i)->output()->connect_ports_to_bundle (bundle, false, this);
}
}
}

View file

@ -725,7 +725,7 @@ Session::add_monitor_section ()
boost::shared_ptr<Bundle> b = bundle_by_name (Config->get_monitor_bus_preferred_bundle());
if (b) {
_monitor_out->output()->connect_ports_to_bundle (b, this);
_monitor_out->output()->connect_ports_to_bundle (b, true, this);
} else {
warning << string_compose (_("The preferred I/O for the monitor bus (%1) cannot be found"),
Config->get_monitor_bus_preferred_bundle())