From 355528781dbab822dfa558ae1720577e656e70bb Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Feb 2021 19:14:57 +0100 Subject: [PATCH] Fix Bundle Editor: show connected ports PortGroupList::gather() first adds UserBundle ports to `system->add_bundle (*i, allow_dups);` That can include ports that are already associated with the current bundle. The port in this case has the Bundle's name. Those ports are later removed in BundleEditorMatrix::setup_ports `_ports[OTHER].remove_bundle (_bundle);` However we do need to show physical ports by their name, even if they're identical to the already associated bundle to allow disassociating them. --- gtk2_ardour/bundle_manager.cc | 4 ++-- gtk2_ardour/port_group.cc | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/bundle_manager.cc b/gtk2_ardour/bundle_manager.cc index e6260ae4d0..1b8fd4a606 100644 --- a/gtk2_ardour/bundle_manager.cc +++ b/gtk2_ardour/bundle_manager.cc @@ -59,8 +59,8 @@ BundleEditorMatrix::setup_ports (int dim) _ports[OTHER].suspend_signals (); /* when we gather, allow the matrix to contain bundles with duplicate port sets, - otherwise in some cases the basic system IO ports may be hidden, making - the bundle editor useless */ + * otherwise ports already associated with this bundle will be hidden, making + * the bundle editor useless */ _ports[OTHER].gather (_session, DataType::NIL, _bundle->ports_are_inputs(), true, show_only_bundles ()); _ports[OTHER].remove_bundle (_bundle); diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index 15f0d2ac2f..30c4aa828f 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -587,12 +587,15 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp std::string const p = *s; - if (!system->has_port(p) && - !bus->has_port(p) && - !track->has_port(p) && - !sidechain->has_port(p) && - !program->has_port(p) && - !other->has_port(p)) { + if (allow_dups || ( + !system->has_port(p) + && !bus->has_port(p) + && !track->has_port(p) + && !sidechain->has_port(p) + && !program->has_port(p) + && !other->has_port(p) + ) + ) { /* special hack: ignore MIDI ports labelled Midi-Through. these are basically useless and mess things up for default @@ -670,7 +673,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) { if (!extra_system[*i].empty()) { boost::shared_ptr b = make_bundle_from_ports (extra_system[*i], *i, inputs); - system->add_bundle (b); + system->add_bundle (b, allow_dups); } }