diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index c47bda3030..70fd5a1b84 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -178,7 +178,20 @@ PortGroupList::refresh () if (p.substr(0, strlen ("system:")) == "system:" || p.substr (0, strlen ("alsa_pcm:")) == "alsa_pcm:") { /* system: or alsa_pcm: prefix */ - _system.add_port (p); + + /* see if this port is already in one of the system: bundles */ + std::vector >::iterator i = _system.bundles.begin(); + while (i != _system.bundles.end()) { + if ((*i)->uses_port (p)) { + break; + } + ++i; + } + + if (i == _system.bundles.end()) { + /* it's not already in there, so add it */ + _system.add_port (p); + } } else { if (p.substr(0, client_matching_string.length()) != client_matching_string) { /* other (non-ardour) prefix */ diff --git a/gtk2_ardour/port_matrix_grid.cc b/gtk2_ardour/port_matrix_grid.cc index 13e1dcf4c2..f63cd231d7 100644 --- a/gtk2_ardour/port_matrix_grid.cc +++ b/gtk2_ardour/port_matrix_grid.cc @@ -200,15 +200,15 @@ PortMatrixGrid::button_press (double x, double y, int b) PortMatrix::State const s = _port_matrix->get_state ( our_bundle, our_channel, other_bundle, other_channel ); - + if (s == PortMatrix::ASSOCIATED || s == PortMatrix::NOT_ASSOCIATED) { bool const n = !(s == PortMatrix::ASSOCIATED); - _port_matrix->set_state ( - our_bundle, our_channel, other_bundle, other_channel, + _port_matrix->set_state ( + our_bundle, our_channel, other_bundle, other_channel, n, 0 - ); + ); } require_render ();